summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql/base.py
Commit message (Collapse)AuthorAgeFilesLines
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* - MySQL error 2014 "commands out of sync" appears to be raised as aMike Bayer2014-06-271-1/+1
| | | | | | | ProgrammingError, not OperationalError, in modern MySQL-Python versions; all MySQL error codes that are tested for "is disconnect" are now checked within OperationalError and ProgrammingError regardless. fixes #3101
* - Fixed bug where column names added to ``mysql_length`` parameterMike Bayer2014-06-181-3/+7
| | | | | | | | on an index needed to have the same quoting for quoted names in order to be recognized. The fix makes the quotes optional but also provides the old behavior for backwards compatibility with those using the workaround. fixes #3085
* - fix some identity map accessorsMike Bayer2014-05-241-1/+1
| | | | - fix a bad comparison in MySQL w/ limit/offset thing
* Merge branch 'issue_3034' of ↵Mike Bayer2014-05-161-8/+8
|\ | | | | | | https://bitbucket.org/dobesv/sqlalchemy/branch/issue_3034 into ticket_3034
| * Use _offset_clause and _limit_clause, which are always Visitable and usually ↵Dobes Vandermeer2014-04-251-8/+8
| | | | | | | | a BindParameter, instead of _offset and _limit in GenerativeSelect.
* | Added optional '=' to MySQL KEY_BLOCK_SIZE regexW. Sean McGivern2014-04-191-1/+1
|/
* - add a topological rule here to place PARTITIONS after PARTITION_BY,Mike Bayer2014-02-191-1/+2
| | | | for output consistency within the tests as well as in practice
* - Added new MySQL-specific :class:`.mysql.DATETIME` which includesMike Bayer2014-02-191-17/+73
| | | | | | | fractional seconds support; also added fractional seconds support to :class:`.mysql.TIMESTAMP`. DBAPI support is limited, though fractional seconds are known to be supported by MySQL Connector/Python. Patch courtesy Geert JM Vanderkelen. #2941
* Merge branch 'master' of https://bitbucket.org/50onred/sqlalchemy/overview ↵Mike Bayer2014-02-191-2/+2
|\ | | | | | | into t
| * Fixes MySQL dialect partitioningMarcus McCurdy2014-02-141-2/+2
| |
* | - expand docs on MySQL table arguments beyond just storage enginesMike Bayer2014-02-151-30/+63
|/ | | | | - clarify section on "foreign key reflection" and group this in a section that refers to foreign keys.
* - Added new test coverage for so-called "down adaptions" of SQL types,Mike Bayer2014-01-221-3/+4
| | | | | | | | | | | where a more specific type is adapted to a more generic one - this use case is needed by some third party tools such as ``sqlacodegen``. The specific cases that needed repair within this test suite were that of :class:`.mysql.ENUM` being downcast into a :class:`.types.Enum`, and that of SQLite date types being cast into generic date types. The ``adapt()`` method needed to become more specific here to counteract the removal of a "catch all" ``**kwargs`` collection on the base :class:`.TypeEngine` class that was removed in 0.9. [ticket:2917]
* - implement kwarg validation and type system for dialect-specificMike Bayer2014-01-181-9/+25
| | | | | arguments; [ticket:2866] - add dialect specific kwarg functionality to ForeignKeyConstraint, ForeignKey
* - The MySQL CAST compilation now takes into account aspects of a stringMike Bayer2014-01-131-9/+25
| | | | | | | | | | | | | | | | | | | | | type such as "charset" and "collation". While MySQL wants all character- based CAST calls to use the CHAR type, we now create a real CHAR object at CAST time and copy over all the parameters it has, so that an expression like ``cast(x, mysql.TEXT(charset='utf8'))`` will render ``CAST(t.col AS CHAR CHARACTER SET utf8)``. - Added new "unicode returns" detection to the MySQL dialect and to the default dialect system overall, such that any dialect can add extra "tests" to the on-first-connect "does this DBAPI return unicode directly?" detection. In this case, we are adding a check specifically against the "utf8" encoding with an explicit "utf8_bin" collation type (after checking that this collation is available) to test for some buggy unicode behavior observed with MySQLdb version 1.2.3. While MySQLdb has resolved this issue as of 1.2.4, the check here should guard against regressions. The change also allows the "unicode" checks to log in the engine logs, which was not previously the case. [ticket:2906]
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - Improvements to the system by which SQL types generate withinMike Bayer2013-12-181-8/+27
| | | | | | | | ``__repr__()``, particularly with regards to the MySQL integer/numeric/ character types which feature a wide variety of keyword arguments. The ``__repr__()`` is important for use with Alembic autogenerate for when Python code is rendered in a migration script. [ticket:2893]
* - work in progress, will squashMike Bayer2013-11-281-10/+3
|
* Merge branch 'for_update_of' of github.com:mlassnig/sqlalchemy into ↵Mike Bayer2013-11-281-1/+8
|\ | | | | | | for_update_of
| * added LockmodeArgspr/42Mario Lassnig2013-11-281-1/+8
| |
* | - evaulate decimal_return_scale statelessly. Don't re-assign to ↵Mike Bayer2013-11-231-2/+0
| | | | | | | | | | | | self.decimal_return_scale so that __repr__() is maintained (for alembic tests)
* | - The precision used when coercing a returned floating point value toMike Bayer2013-11-221-1/+18
|/ | | | | | | | | | Python ``Decimal`` via string is now configurable. The flag ``decimal_return_scale`` is now supported by all :class:`.Numeric` and :class:`.Float` types, which will ensure this many digits are taken from the native floating point value when it is converted to string. If not present, the type will make use of the value of ``.scale``, if the type supports this setting and it is non-None. Otherwise the original default length of 10 is used. [ticket:2867]
* - Fix and test parsing of MySQL foreign key options within reflection;Mike Bayer2013-10-251-1/+1
| | | | | | this complements the work in :ticket:`2183` where we begin to support reflection of foreign key options such as ON UPDATE/ON DELETE cascade. [ticket:2839]
* Merge branch 'master' of github.com:ijl/sqlalchemy into merge_2183Mike Bayer2013-10-251-1/+1
|\
| * #2183: Metadata.reflect() foreign keys include options when the dialect ↵ijl2013-10-131-1/+1
| | | | | | | | exposes it
* | - The change in :ticket:`2721`, which is that the ``deferrable`` keywordMike Bayer2013-10-181-1/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of :class:`.ForeignKeyConstraint` is silently ignored on the MySQL backend, will be reverted as of 0.9; this keyword will now render again, raising errors on MySQL as it is not understood - the same behavior will also apply to the ``initially`` keyword. In 0.8, the keywords will remain ignored but a warning is emitted. Additionally, the ``match`` keyword now raises a :class:`.CompileError` on 0.9 and emits a warning on 0.8; this keyword is not only silently ignored by MySQL but also breaks the ON UPDATE/ON DELETE options. To use a :class:`.ForeignKeyConstraint` that does not render or renders differently on MySQL, use a custom compilation option. An example of this usage has been added to the documentation, see :ref:`mysql_foreign_keys`. [ticket:2721] [ticket:2839]
* | The MySQL :class:`.mysql.SET` type now features the same auto-quotingMike Bayer2013-10-141-66/+87
| | | | | | | | | | | | | | behavior as that of :class:`.mysql.ENUM`. Quotes are not required when setting up the value, but quotes that are present will be auto-detected along with a warning. This also helps with Alembic where the SET type doesn't render with quotes. [ticket:2817]
* | - Fixed bug in default compiler plus those of postgresql, mysql, andMike Bayer2013-10-121-1/+2
|/ | | | | | | | mssql to ensure that any literal SQL expression values are rendered directly as literals, instead of as bound parameters, within a CREATE INDEX statement. [ticket:2742] - don't need expression_as_ddl(); literal_binds and include_table take care of this functionality.
* - A rework to the way that "quoted" identifiers are handled, in thatMike Bayer2013-08-271-4/+3
| | | | | | | | | | | | | | | | instead of relying upon various ``quote=True`` flags being passed around, these flags are converted into rich string objects with quoting information included at the point at which they are passed to common schema constructs like :class:`.Table`, :class:`.Column`, etc. This solves the issue of various methods that don't correctly honor the "quote" flag such as :meth:`.Engine.has_table` and related methods. The :class:`.quoted_name` object is a string subclass that can also be used explicitly if needed; the object will hold onto the quoting preferences passed and will also bypass the "name normalization" performed by dialects that standardize on uppercase symbols, such as Oracle, Firebird and DB2. The upshot is that the "uppercase" backends can now work with force-quoted names, such as lowercase-quoted names and new reserved words. [ticket:2812]
* move FAQ to the docs, [ticket:2133]Mike Bayer2013-08-211-0/+2
|
* - A large refactoring of the ``sqlalchemy.sql`` package has reorganizedMike Bayer2013-08-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | the import structure of many core modules. ``sqlalchemy.schema`` and ``sqlalchemy.types`` remain in the top-level package, but are now just lists of names that pull from within ``sqlalchemy.sql``. Their implementations are now broken out among ``sqlalchemy.sql.type_api``, ``sqlalchemy.sql.sqltypes``, ``sqlalchemy.sql.schema`` and ``sqlalchemy.sql.ddl``, the last of which was moved from ``sqlalchemy.engine``. ``sqlalchemy.sql.expression`` is also a namespace now which pulls implementations mostly from ``sqlalchemy.sql.elements``, ``sqlalchemy.sql.selectable``, and ``sqlalchemy.sql.dml``. Most of the "factory" functions used to create SQL expression objects have been moved to classmethods or constructors, which are exposed in ``sqlalchemy.sql.expression`` using a programmatic system. Care has been taken such that all the original import namespaces remain intact and there should be no impact on any existing applications. The rationale here was to break out these very large modules into smaller ones, provide more manageable lists of function names, to greatly reduce "import cycles" and clarify the up-front importing of names, and to remove the need for redundant functions and documentation throughout the expression package.
* Updates to MySQL reserved words for versions 5.5, 5.6, courtesyMike Bayer2013-07-311-0/+10
| | | | | Hanno Schlichting. Also in 0.8.3, 0.7.11. [ticket:2791]
* this comment is ancientMike Bayer2013-06-091-5/+0
|
* Add basic support of unique constraints reflectionpr/4Roman Podolyaka2013-06-091-0/+15
| | | | | | | | | | | | Inspection API already supports reflection of table indexes information and those also include unique constraints (at least for PostgreSQL and MySQL). But it could be actually useful to distinguish between indexes and plain unique constraints (though both are implemented in the same way internally in RDBMS). This change adds a new method to Inspection API - get_unique_constraints() and implements it for SQLite, PostgreSQL and MySQL dialects.
* - changelog for [ticket:2704]Mike Bayer2013-06-081-9/+13
| | | | - use an isinstance() check, concerned a TypeError might be indiscriminate
* Fix using of 'mysql_length' for composite indexesRoman Podolyaka2013-06-081-7/+25
| | | | | | | | | | | | | | | | | Currently, one can specify the prefix length for an index column using 'mysql_length' keyword argument when creating an Index instance. But in case of composite indexes the prefix length value is applied only to the last column. Extend the existing API in way so that 'mysql_length' argument value can be either: - an integer specifying the same prefix length value for each column of an index - a (column_name --> integer value) mapping specifying the prefix length value for each column of an index separately Fixes issue #2704.
* The ``deferrable`` keyword argument on :class:`.ForeignKey` andMike Bayer2013-06-031-0/+2
| | | | | | | | :class:`.ForeignKeyConstraint` will not render the ``DEFERRABLE`` keyword on the MySQL dialect. For a long time we left this in place because a non-deferrable foreign key would act very differently than a deferrable one, but some environments just disable FKs on MySQL, so we'll be less opinionated here. [ticket:2721]
* mysql testsMike Bayer2013-05-261-5/+1
|
* merge defaultMike Bayer2013-04-291-26/+15
|\
| * - fix long-outdated documentation for sql_mode/ansiquotes,Mike Bayer2013-04-291-26/+15
| | | | | | | | closes [ticket:1552]
* | plugging awayMike Bayer2013-04-271-18/+9
| |
* | - the raw 2to3 runMike Bayer2013-04-271-21/+23
|/ | | | - went through examples/ and cleaned out excess list() calls
* - changelogMike Bayer2013-04-211-1/+1
| | | | - just do a fetchone() here, no need for len() etc.
* merge cymysql branchMike Bayer2013-04-211-1/+1
|\
| * select not return rowcount at mysql+cymysqlHajime Nakagami2013-04-061-1/+1
| |
* | - Improvements to the operation of the pymysql dialect onMike Bayer2013-04-211-5/+2
| | | | | | | | | | | | | | | | Python 3, including some important decode/bytes steps. Issues remain with BLOB types due to driver issues. Courtesy Ben Trofatter. - start using util.py3k, we will eventually remove the sa2to3 fixer entirely
* | Merged in bentrofatter/sqlalchemy-2663 (pull request #49)Mike Bayer2013-04-211-0/+5
|\ \ | |/ |/| | | Fixed PyMySQL problems for Python 2.x and mitigated some issues with Python 3.x
| * Added workaround for pymysql3 double wrapping ProgrammingErrors to pymysql ↵Ben Trofatter2013-03-181-0/+5
| | | | | | | | | | | | dialect. Added workaround for pymysql3 return a bytes object when queried for isolation level.
* | - add a nose runner that erases out argv, otherwiseMike Bayer2013-03-251-1/+0
|/ | | | | you get "import test" as what it tries to run with setup.py test
* more egregious long linesMike Bayer2013-02-021-37/+68
|