summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql/pyodbc.py
Commit message (Collapse)AuthorAgeFilesLines
* happy new year 2023Mike Bayer2023-01-031-1/+1
| | | | Change-Id: I625af65b3fb1815b1af17dc2ef47dd697fdc3fb1
* Try running pyupgrade on the codeFederico Caselli2022-11-161-1/+1
| | | | | | | | command run is "pyupgrade --py37-plus --keep-runtime-typing --keep-percent-format <files...>" pyupgrade will change assert_ to assertTrue. That was reverted since assertTrue does not exists in sqlalchemy fixtures Change-Id: Ie1ed2675c7b11d893d78e028aad0d1576baebb55
* bypass pyodbc default server version / set charsetMike Bayer2022-05-031-0/+6
| | | | | | | | | Further adjustments to the MySQL PyODBC dialect to allow for complete connectivity, which was previously still not working despite fixes in :ticket:`7871`. Fixes: #7966 Change-Id: I549ea9e7b6e722e22d3e25bdb2fe0934603e2454
* inline mypy config; files ignoring type errors for the momentMike Bayer2022-04-281-0/+2
| | | | | | | | | | | | | | | | | | | to simplify pyproject.toml change the remaining files that aren't going to be typed on this first pass (unless of course someone wants to type some of these) to include # mypy: ignore-errors. for the moment, only a handful of ORM modules are to have more type checking implemented. It's important that ignore-errors is used and not "# type: ignore", as in the latter case, mypy doesn't even read the existing types in the file, which makes it impossible to type any files that refer to those modules at all. to simplify ongoing typing work use inline mypy config for remaining files that are "done" for now, indicating the level of type checking they currently have. Change-Id: I98669c1a305c2f0adba85d10b5425541f3fe9533
* repair fetch_setting call in mysql pyodbc dialectMike Bayer2022-04-261-1/+1
| | | | | | | | | Fixed a regression in the untested MySQL PyODBC dialect caused by the fix for :ticket:`7518` in version 1.4.32 where an argument was being propagated incorrectly upon first connect, leading to a ``TypeError``. Fixes: #7871 Change-Id: I37f8ca8e83cb352ee2a2336b52863858259b1d77
* fall back to SHOW VARIABLES for MySQL < 5.6Mike Bayer2022-02-041-3/+1
| | | | | | | | | | | | | | | Fixed regression caused by :ticket:`7518` where changing the syntax "SHOW VARIABLES" to "SELECT @@" broke compatibility with MySQL versions older than 5.6, including early 5.0 releases. While these are very old MySQL versions, a change in compatibility was not planned, so version-specific logic has been restored to fall back to "SHOW VARIABLES" for MySQL server versions < 5.6. includes unrelated orm/test_expire ordering issue , only showing up on 1.4 / py2.7 but seems to be passing by luck otherwise Fixes: #7518 Change-Id: Ia554080af742f2c3437f88cf3f7a4827b5e55da8
* happy new year 2022Mike Bayer2022-01-061-1/+1
| | | | Change-Id: I49abf2607e0eb0623650efdf0091b1fb3db737ea
* Imrpove MySQL/MariaDB dialect initialization.Federico Caselli2022-01-031-17/+12
| | | | | | | | | | Replace ``SHOW VARIABLES LIKE`` statement with equivalent ``SELECT @@variable`` in MySQL and MariaDB dialect initialization. This should avoid mutex contention caused by ``SHOW VARIABLES``, improving initialization performance. Change-Id: Id836ef534fcc1473c7aaf9270d08a4da9b8f62cf closes: #7518
* Replace all http:// links to https://Federico Caselli2021-07-041-2/+2
| | | | | | Also replace http://pypi.python.org/pypi with https://pypi.org/project Change-Id: I84b5005c39969a82140706472989f2a30b0c7685
* Default caching to opt-out for 3rd party dialectsMike Bayer2021-04-011-0/+1
| | | | | | | | | | | | | | | | | | | Added a new flag to the :class:`_engine.Dialect` class called :attr:`_engine.Dialect.supports_statement_cache`. This flag now needs to be present directly on a dialect class in order for SQLAlchemy's :ref:`query cache <sql_caching>` to take effect for that dialect. The rationale is based on discovered issues such as :ticket:`6173` revealing that dialects which hardcode literal values from the compiled statement, often the numerical parameters used for LIMIT / OFFSET, will not be compatible with caching until these dialects are revised to use the parameters present in the statement only. For third party dialects where this flag is not applied, the SQL logging will show the message "dialect does not support caching", indicating the dialect should seek to apply this flag once they have verified that no per-statement literal values are being rendered within the compilation phase. Fixes: #6184 Change-Id: I6fd5b5d94200458d4cb0e14f2f556dbc25e27e22
* happy new yearMike Bayer2021-01-041-1/+1
| | | | Change-Id: Ic5bb19ca8be3cb47c95a0d3315d84cb484bac47c
* Deprecate plain string in execute and introduce `exec_driver_sql`Federico Caselli2020-03-211-1/+3
| | | | | | | | | | | | | | | Execution of literal sql string is deprecated in the :meth:`.Connection.execute` and a warning is raised when used stating that it will be coerced to :func:`.text` in a future release. To execute a raw sql string the new connection method :meth:`.Connection.exec_driver_sql` was added, that will retain the previous behavior, passing the string to the DBAPI driver unchanged. Usage of scalar or tuple positional parameters in :meth:`.Connection.execute` is also deprecated. Fixes: #4848 Fixes: #5178 Change-Id: I2830181054327996d594f7f0d59c157d477c3aa9
* Enable F821Mike Bayer2020-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In Ia63a510f9c1d08b055eef62cf047f1f427f0450c we introduced "lambda combinations" which use a bit of function closure inspection in order to allow for testing combinations that make use of symbols that come from test fixtures, or from the test itself. Two problems. One is that we can't use F821 flake8 rule without either adding lots of noqas, skipping the file, or adding arguments to the lambdas themselves that are then populated, which makes for a very verbose system. The other is that the system is already verbose with all those lambdas and the magic in use is a non-explicit kind, hence F821 reminds us that if we can improve upon this, we should. So let's improve upon it by making it so that the "lambda" is just once and up front for the whole thing, and let it accept the arguments directly. This still requires magic, because these test cases need to resolve at test collection time, not test runtime. But we will instead substitute a namespace up front that can be coerced into its desired form within the tests. Additionally, there's a little bit of py2k compatible type annotations present; f821 is checking these, so we have to add those imports also using the TYPE_CHECKING boolean so they don't take place in py2k. Change-Id: Idb7e7a0c8af86d9ab133f548511306ef68cdba14
* happy new yearMike Bayer2020-01-011-1/+1
| | | | Change-Id: I08440dc25e40ea1ccea1778f6ee9e28a00808235
* Source base cleanupsMike Bayer2020-01-011-7/+7
| | | | | | | | | | | | | | | in trying to apply 2020 copyright to files, the pre-commit hooks complain about random file issues. - remove old corrections.py utility, this had something to do with repairing refs in the sphinx docs - run pre commit hooks on all files - formatting adjustments to work around code formatting collisions (long import lines that zimports can't rewrite correctly) Change-Id: I260744866f69e902eb93665c7c728ee94d3371a2
* Add pass through exact pyodbc connection string.Gord Thompson2019-12-041-2/+17
|
* Add note re: using the MySQL ODBC "ANSI" driver for mysql+pyodbc.Gord Thompson2019-12-031-5/+10
|
* Merge "add on_connect to MySQLDialect_pyodbc"mike bayer2019-10-201-0/+24
|\
| * add on_connect to MySQLDialect_pyodbcGord Thompson2019-10-201-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: #4876 <!-- Provide a general summary of your proposed changes in the Title field above --> ### Description add on_connect to MySQLDialect_pyodbc to specify Unicode encoding/decoding settings for the pyodbc connection ### Checklist <!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once) --> This pull request is: - [ ] A documentation / typographical error fix - Good to go, no issue or tests are needed - [x] A short code fix - please include the issue number, and create an issue if none exists, which must include a complete example of the issue. one line code fixes without an issue and demonstration will not be accepted. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. one line code fixes without tests will not be accepted. - [ ] A new feature implementation - please include the issue number, and create an issue if none exists, which must include a complete example of how the feature would look. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. **Have a nice day!** Closes: #4885 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4885 Pull-request-sha: 58f6176331702b72f3ea8342c93be6fe9a3db26f Change-Id: If05c1cf8fb1d8efebcf809bdefe40242118d763f
* | Merge remote-tracking branch 'origin/pr/4899'Mike Bayer2019-10-201-1/+1
|\ \ | |/ |/| | | Change-Id: Ie25f79c8845d58ef445b1042861f6735c1d86b7e
| * fix supports_unicode_statements for mysql+pyodbcGord Thompson2019-10-081-1/+1
| | | | | | | | Fixes: #4881
* | fix error in test_round_trip for TimeTest with mysql+pyodbcGord Thompson2019-10-031-0/+12
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: #4879 ### Description create mysql+pyodbc-specific `_pyodbcTIME` class to avoid error thrown by `result_processor` in the (more) generic mysql/types.py. ### Checklist <!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once) --> This pull request is: - [ ] A documentation / typographical error fix - Good to go, no issue or tests are needed - [x] A short code fix - please include the issue number, and create an issue if none exists, which must include a complete example of the issue. one line code fixes without an issue and demonstration will not be accepted. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. one line code fixes without tests will not be accepted. - [ ] A new feature implementation - please include the issue number, and create an issue if none exists, which must include a complete example of how the feature would look. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. **Have a nice day!** Closes: #4880 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4880 Pull-request-sha: 2e4c468c3ad685d6573e0d9755ba97a28df50b6c Change-Id: Ib5c5b0971969c2a9870b7f43d06703618cfc56f7
* remove __init__ from MySQLDialect_pyodbcGord Thompson2019-10-021-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: #4869 <!-- Provide a general summary of your proposed changes in the Title field above --> ### Description remove __init__ from MySQLDialect_pyodbc, specifically to get rid of the convert_unicode flag ### Checklist <!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once) --> This pull request is: - [ ] A documentation / typographical error fix - Good to go, no issue or tests are needed - [x] A short code fix - please include the issue number, and create an issue if none exists, which must include a complete example of the issue. one line code fixes without an issue and demonstration will not be accepted. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. one line code fixes without tests will not be accepted. - [ ] A new feature implementation - please include the issue number, and create an issue if none exists, which must include a complete example of how the feature would look. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. **Have a nice day!** Closes: #4884 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4884 Pull-request-sha: d63550aca4ff9321e094fcb02105ecfa9d1076e1 Change-Id: I8986f7bf6de4d2b221106eded63576439d467c0f
* happy new yearMike Bayer2019-01-111-1/+1
| | | | Change-Id: I6a71f4924d046cf306961c58dffccf21e9c03911
* Post black reformattingMike Bayer2019-01-061-3/+5
| | | | | | | | | | | | | Applied on top of a pure run of black -l 79 in I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9, this set of changes resolves all remaining flake8 conditions for those codes we have enabled in setup.cfg. Included are resolutions for all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I4f72d3ba1380dd601610ff80b8fb06a2aff8b0fe
* Run black -l 79 against all source filesMike Bayer2019-01-061-6/+8
| | | | | | | | | | | | | | This is a straight reformat run using black as is, with no edits applied at all. The black run will format code consistently, however in some cases that are prevalent in SQLAlchemy code it produces too-long lines. The too-long lines will be resolved in the following commit that will resolve all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9
* happy new yearMike Bayer2018-01-121-1/+1
| | | | Change-Id: I3ef36bfd0cb0ba62b3123c8cf92370a43156cf8f
* New features from python 2.7Катаев Денис2017-03-171-1/+1
| | | | | | | After bump minimum supported version to 2.7 (1da9d3752160430c91534a8868ceb8c5ad1451d4), we can use new syntax. Change-Id: Ib064c75a00562e641d132f9c57e5e69744200e05 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/347
* update for 2017 copyrightMike Bayer2017-01-041-1/+1
| | | | Change-Id: I4e8c2aa8fe817bb2af8707410fa0201f938781de
* - happy new yearMike Bayer2016-01-291-1/+1
|
* - reorganize MySQL docs re: unicode, other cleanup and updatesMike Bayer2015-03-201-8/+5
|
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-201-1/+2
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* - happy new yearMike Bayer2014-01-051-1/+1
|
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* juts a 'expected 2 blank lines' pep8 passDiana Clarke2012-11-191-0/+2
|
* - rework the sphinx customizations into distinct modulesMike Bayer2012-10-191-12/+6
| | | | | | | - build a new Sphinx extension that allows dialect info to be entered as directives which is then rendered consistently throughout all dialect/dbapi sections - break out the "empty_strings" requirement for oracle test
* - move out maxdbMike Bayer2012-10-181-0/+3
| | | | | | - begin consolidating docs for dialects to be more self contained - add a separate section for "external" dialects - not sure how we're going to go with this yet.
* more import cleanupsMike Bayer2012-08-071-4/+3
|
* -whitespace bonanza, contdMike Bayer2012-07-281-1/+1
|
* happy new yearMike Bayer2012-01-041-1/+1
|
* - whitespace removal bonanzaMike Bayer2011-01-021-2/+2
|
* - clean up copyright, update for 2011, stamp every file withMike Bayer2011-01-021-0/+6
| | | | | a consistent tag - AUTHORS file
* - _extract_error_code now expects the raw DBAPI error in all casesMike Bayer2010-07-131-1/+1
| | | | | for all four MySQL dialects. has_table() passes in the "orig" from the SQLAlchemy exception. continuing of [ticket:1848]
* documentation updatesMike Bayer2010-03-281-0/+19
|
* - name all the "sub" dialect components <DB><component>_<dialectname>, ↵Mike Bayer2010-03-141-5/+5
| | | | [ticket:1738]
* - added _with_options() to Connection. not publicizing this yet.Mike Bayer2009-12-181-0/+4
| | | | | | - updated oursql driver with latest fixes using options. [ticket:1613] - all the MySQL drivers get a shoutout in the docs - marked tests that OurSQL has problems with (only three), passes 100% now
* get mysql+pyodbc connections to work againMike Bayer2009-08-201-2/+1
|
* merge 0.6 series to trunk.Mike Bayer2009-08-061-0/+54