summaryrefslogtreecommitdiff
path: root/test/sql
Commit message (Collapse)AuthorAgeFilesLines
* - The :meth:`.TypeEngine.with_variant` method will now accept aMike Bayer2014-07-101-0/+7
| | | | | | type class as an argument which is internally converted to an instance, using the same convention long established by other constructs such as :class:`.Column`. fixes #3122
* PEP8 tidy of subset of test/sql/*.pypr/103Tony Locke2014-07-074-602/+745
|
* pg8000 passing test/sqlTony Locke2014-07-064-13/+16
|
* Merge pull request #99 from tlocke/mastermike bayer2014-07-061-234/+267
|\ | | | | pg8000 passing test/sql/test_types.py
| * PEP8 tidy of test/sql/test_types.pypr/99Tony Locke2014-06-231-221/+256
| |
| * pg8000 passing test/sql/test_types.pyTony Locke2014-06-231-13/+11
| | | | | | | | | | | | | | Opened up two tests that now pass with pg8000. Also, rewrote two tests to use actual tables rather than having a round trip in a single select statement. This is necessary for pg8000 because it sends strings to the server with type 'unknown' and lets the server work out the type.
* | - Fixed a bug within the custom operator plus :meth:`.TypeEngine.with_variant`Mike Bayer2014-06-271-1/+30
|/ | | | | | system, whereby using a :class:`.TypeDecorator` in conjunction with variant would fail with an MRO error when a comparison operator was used. fixes #3102
* - fix test failuresMike Bayer2014-06-211-3/+3
|
* - The :paramref:`.Column.nullable` flag is implicitly set to ``False``Mike Bayer2014-06-201-0/+18
| | | | | | | | | when that :class:`.Column` is referred to in an explicit :class:`.PrimaryKeyConstraint` for that table. This behavior now matches that of when the :class:`.Column` itself has the :paramref:`.Column.primary_key` flag set to ``True``, which is intended to be an exactly equivalent case. fixes #3023
* - Fixed bug in INSERT..FROM SELECT construct where selecting from aMike Bayer2014-05-251-1/+19
| | | | | UNION would wrap the union in an anonymous (e.g. unlabled) subquery. fixes #3044
* - Fixed bug in SQLite join rewriting where anonymized column namesMike Bayer2014-05-252-1/+57
| | | | | | due to repeats would not correctly be rewritten in subqueries. This would affect SELECT queries with any kind of subquery + join. fixes #3057
* - Fixed bug where the :meth:`.Operators.__and__`,Mike Bayer2014-05-241-0/+49
| | | | | | | :meth:`.Operators.__or__` and :meth:`.Operators.__invert__` operator overload methods could not be overridden within a custom :class:`.TypeEngine.Comparator` implementation. fixes #3012
* - more tests, including backend testsMike Bayer2014-05-161-0/+53
| | | | - implement for SQL server, use window functions when simple limit/offset not available
* - Fixed bug where :meth:`.Table.update` and :meth:`.Table.delete`Mike Bayer2014-05-083-1/+33
| | | | | | | would produce an empty WHERE clause when an empty :func:`.and_()` or :func:`.or_()` or other blank expression were applied. This is now consistent with that of :func:`.select`. fixes #3045
* - Fixed bug where the combination of "limit" rendering asMike Bayer2014-04-301-0/+29
| | | | | | | | | "SELECT FIRST n ROWS" using a bound parameter (only firebird has both), combined with column-level subqueries which also feature "limit" as well as "positional" bound parameters (e.g. qmark style) would erroneously assign the subquery-level positions before that of the enclosing SELECT, thus returning parameters which are out of order. Fixes #3038
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-267-10/+10
| | | | Found using: https://github.com/intgr/topy
* - Liberalized the contract for :class:`.Index` a bit in that you canMike Bayer2014-04-192-12/+102
| | | | | | | specify a :func:`.text` expression as the target; the index no longer needs to have a table-bound column present if the index is to be manually added to the table, either via inline declaration or via :meth:`.Table.append_constraint`. fixes #3028
* - Fixed bug in new :meth:`.DialectKWArgs.argument_for` method whereMike Bayer2014-04-151-0/+11
| | | | | adding an argument for a construct not previously included for any special arguments would fail. fixes #3024
* fix unclosed file ResourceWarningMatt Chisholm2014-04-141-1/+2
| | | | part of #2830
* - Fixed regression introduced in 0.9 where new "ORDER BY <labelname>"Mike Bayer2014-04-101-0/+9
| | | | | | feature from :ticket:`1068` would not apply quoting rules to the label name as rendered in the ORDER BY. fix #3020, re: #1068
* - reverse order of columns in sample CTEs as this is a UNION and the cols ↵Mike Bayer2014-04-021-5/+5
| | | | | | | | | | need to line up - alter this in the unit tests as well as these queries were just copied from the tests - remove the included_parts.join(parts) from the core CTE doc (also just copied from the test, where we want to make sure joins don't get screwed up with the CTE) as it doesn't contribute to the query itself fixes #3014
* - Fixes to the newly enhanced boolean coercion in :ticket:`2804` whereMike Bayer2014-04-011-3/+27
| | | | | | | the new rules for "where" and "having" woudn't take effect for the "whereclause" and "having" kw arguments of the :func:`.select` construct, which is also what :class:`.Query` uses so wasn't working in the ORM either. fixes #3013 re: #2804
* - Added new flag :paramref:`.expression.between.symmetric`, when set to TrueMike Bayer2014-03-301-3/+43
| | | | | | | renders "BETWEEN SYMMETRIC". Also added a new negation operator "notbetween_op", which now allows an expression like ``~col.between(x, y)`` to render as "col NOT BETWEEN x AND y", rather than a parentheiszed NOT string. fixes #2990
* mark failing tests for buggy mysqlconnectorMike Bayer2014-03-281-0/+21
|
* - add further coverage for join_condition to make sure we get this case whereMike Bayer2014-03-281-0/+10
| | | | there are multiple, equivalent foreign keys
* - rename __multiple__ to __backend__, and apply __backend__ to a large ↵Mike Bayer2014-03-2410-3/+65
| | | | | | number of tests. - move out logging tests from test_execute to test_logging
* - Fixed a few errant ``u''`` strings that would prevent tests from passingMike Bayer2014-03-221-1/+1
| | | | in Py3.2. Patch courtesy Arfrever Frehtes Taifersar Arahesis. fixes #2980
* - Added support for literal rendering of boolean values, e.g.Mike Bayer2014-03-131-43/+9
| | | | | "true" / "false" or "1" / "0". - added Boolean tests to the test suite
* - add more support for suite tests, moving some tests from test_query out to ↵Mike Bayer2014-03-131-153/+24
| | | | | | suite and adding some more requirements
* :paramref:`.MetaData.naming_convention` feature will now alsoMike Bayer2014-03-121-0/+17
| | | | | | apply to :class:`.CheckConstraint` objects that are associated directly with a :class:`.Column` instead of just on the :class:`.Table`.
* - Fixed bug in new :paramref:`.MetaData.naming_convention` featureMike Bayer2014-03-121-1/+37
| | | | | | | | | where the name of a check constraint making use of the `"%(constraint_name)s"` token would get doubled up for the constraint generated by a boolean or enum type, and overall duplicate events would cause the `"%(constraint_name)s"` token to keep compounding itself. fixes #2991
* - Support has been added for pytest to run tests. This runnerMike Bayer2014-03-035-99/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | is currently being supported in addition to nose, and will likely be preferred to nose going forward. The nose plugin system used by SQLAlchemy has been split out so that it works under pytest as well. There are no plans to drop support for nose at the moment and we hope that the test suite itself can continue to remain as agnostic of testing platform as possible. See the file README.unittests.rst for updated information on running tests with pytest. The test plugin system has also been enhanced to support running tests against mutiple database URLs at once, by specifying the ``--db`` and/or ``--dburi`` flags multiple times. This does not run the entire test suite for each database, but instead allows test cases that are specific to certain backends make use of that backend as the test is run. When using pytest as the test runner, the system will also run specific test suites multiple times, once for each database, particularly those tests within the "dialect suite". The plan is that the enhanced system will also be used by Alembic, and allow Alembic to run migration operation tests against multiple backends in one run, including third-party backends not included within Alembic itself. Third party dialects and extensions are also encouraged to standardize on SQLAlchemy's test suite as a basis; see the file README.dialects.rst for background on building out from SQLAlchemy's test platform.
* - Fixed bug in :func:`.tuple_` construct where the "type" of essentiallyMike Bayer2014-02-271-1/+21
| | | | | | | | | | | the first SQL expression would be applied as the "comparison type" to a compared tuple value; this has the effect in some cases of an inappropriate "type coersion" occurring, such as when a tuple that has a mix of String and Binary values improperly coerces target values to Binary even though that's not what they are on the left side. :func:`.tuple_` now expects heterogeneous types within its list of values. fixes #2977
* - Adjusted the logic which applies names to the .c collection whenMike Bayer2014-02-262-3/+9
| | | | | | | | | a no-name :class:`.BindParameter` is received, e.g. via :func:`.sql.literal` or similar; the "key" of the bind param is used as the key within .c. rather than the rendered name. Since these binds have "anonymous" names in any case, this allows individual bound parameters to have their own name within a selectable if they are otherwise unlabeled. fixes #2974
* - Some changes to how the :attr:`.FromClause.c` collection behavesMike Bayer2014-02-261-0/+35
| | | | | | | | | | | | | | | | | | | | | | | when presented with duplicate columns. The behavior of emitting a warning and replacing the old column with the same name still remains to some degree; the replacement in particular is to maintain backwards compatibility. However, the replaced column still remains associated with the ``c`` collection now in a collection ``._all_columns``, which is used by constructs such as aliases and unions, to deal with the set of columns in ``c`` more towards what is actually in the list of columns rather than the unique set of key names. This helps with situations where SELECT statements with same-named columns are used in unions and such, so that the union can match the columns up positionally and also there's some chance of :meth:`.FromClause.corresponding_column` still being usable here (it can now return a column that is only in selectable.c._all_columns and not otherwise named). The new collection is underscored as we still need to decide where this list might end up. Theoretically it would become the result of iter(selectable.c), however this would mean that the length of the iteration would no longer match the length of keys(), and that behavior needs to be checked out. fixes #2974 - add a bunch more tests for ColumnCollection
* - Fixed issue in new :meth:`.TextClause.columns` method where the orderingMike Bayer2014-02-262-0/+39
| | | | | | of columns given positionally would not be preserved. This could have potential impact in positional situations such as applying the resulting :class:`.TextAsFrom` object to a union.
* - The new dialect-level keyword argument system for schema-levelMike Bayer2014-02-251-0/+133
| | | | | | | | | constructs has been enhanced in order to assist with existing schemes that rely upon addition of ad-hoc keyword arguments to constructs. - To suit the use case of allowing custom arguments at construction time, the :meth:`.DialectKWArgs.argument_for` method now allows this registration. fixes #2962
* - we're testing a query here with non-standard aliasing which fails on PG ↵Mike Bayer2014-02-241-0/+6
| | | | | | | and MySQL. Leave this test in place as its ultimately a SQLite use case, but only test on SQLite. We perhaps should add another test case that works on all platforms.
* - More fixes to SQLite "join rewriting"; the fix from :ticket:`2967`Mike Bayer2014-02-201-2/+66
| | | | | | | | | | | | | | implemented right before the release of 0.9.3 affected the case where a UNION contained nested joins in it. "Join rewriting" is a feature with a wide range of possibilities and is the first intricate "SQL rewriting" feature we've introduced in years, so we're sort of going through a lot of iterations with it (not unlike eager loading back in the 0.2/0.3 series, polymorphic loading in 0.4/0.5). We should be there soon so thanks for bearing with us :). fixes #2969 re: #2967 - solve the issue of join rewriting inspecting various types of from objects without using isinstance(), by adding some new underscored inspection flags to the FromClause hierarchy.
* skip this on oracleMike Bayer2014-02-191-0/+3
|
* - re: #2967, also fixed a somewhat related issue where join rewriting would failMike Bayer2014-02-191-1/+38
| | | | | on the columns clause of the SELECT statement if the targets were aliased tables, as opposed to individual aliased columns.
* - Fixed bug in SQLite "join rewriting" where usage of an exists() constructMike Bayer2014-02-191-4/+56
| | | | | would fail to be rewritten properly, such as when the exists is mapped to a column_property in an intricate nested-join scenario. #2967
* - Fixed bug where calling :meth:`.Insert.values` with an empty listMike Bayer2014-02-191-0/+23
| | | | | or tuple would raise an IndexError. It now produces an empty insert construct as would be the case with an empty dictionary.
* - Fixed bug where :meth:`.in_()` would go into an endless loop ifMike Bayer2014-02-131-0/+33
| | | | | | erroneously passed a column expression whose comparator included the ``__getitem__()`` method, such as a column that uses the :class:`.postgresql.ARRAY` type. [ticket:2957]
* - for TextAsFrom, put the "inner" columns in the result map directly.Mike Bayer2014-02-102-5/+141
| | | | | | | Have also considered linking column.label() to the "column" itself being in the result map but this reveals some naming collision problems (that also seem to be very poorly tested...). This should be as far as we want to go right now with [ticket:2932].
* - More issues with [ticket:2932] first resolved in 0.9.2 whereMike Bayer2014-02-051-0/+30
| | | | | | | | | | using a column key of the form ``<tablename>_<columnname>`` matching that of an aliased column in the text would still not match at the ORM level, which is ultimately due to a core column-matching issue. Additional rules have been added so that the column ``_label`` is taken into account when working with a :class:`.TextAsFrom` construct or with literal columns. [ticket:2932]
* - Fixed regression in new "naming convention" feature where conventionsMike Bayer2014-02-051-2/+20
| | | | | would fail if the referred table in a foreign key contained a schema name. Pull request courtesy Thomas Farvour. pullreq github:67
* - Fixed bug where so-called "literal render" of :func:`.bindparam`Mike Bayer2014-02-051-0/+7
| | | | | | constructs would fail if the bind were constructed with a callable, rather than a direct value. This prevented ORM expressions from being rendered with the "literal_binds" compiler flag.
* - The behavior of :meth:`.Table.tometadata` has been adjusted such thatMike Bayer2014-02-021-168/+308
| | | | | | | | | | | | | | | | | | | | | | | | the schema target of a :class:`.ForeignKey` will not be changed unless that schema matches that of the parent table. That is, if a table "schema_a.user" has a foreign key to "schema_b.order.id", the "schema_b" target will be maintained whether or not the "schema" argument is passed to :meth:`.Table.tometadata`. However if a table "schema_a.user" refers to "schema_a.order.id", the presence of "schema_a" will be updated on both the parent and referred tables. This is a behavioral change hence isn't likely to be backported to 0.8; it is assumed that the previous behavior is pretty buggy however and that it's unlikely anyone was relying upon it. Additionally, a new parameter has been added :paramref:`.Table.tometadata.referred_schema_fn`. This refers to a callable function which will be used to determine the new referred schema for any :class:`.ForeignKeyConstraint` encountered in the tometadata operation. This callable can be used to revert to the previous behavior or to customize how referred schemas are treated on a per-constraint basis. [ticket:2913] - rework the tests in test.sql.test_metadata, all the "tometadata" tests now under new class ToMetaDataTest
* - Fixed bug in new :class:`.TextAsFrom` construct where :class:`.Column`-Mike Bayer2014-02-021-0/+45
| | | | | | | | | | oriented row lookups were not matching up to the ad-hoc :class:`.ColumnClause` objects that :class:`.TextAsFrom` generates, thereby making it not usable as a target in :meth:`.Query.from_statement`. Also fixed :meth:`.Query.from_statement` mechanics to not mistake a :class:`.TextAsFrom` for a :class:`.Select` construct. This bug is also an 0.9 regression as the :meth:`.Text.columns` method is called to accommodate the :paramref:`.text.typemap` argument. [ticket:2932]