43 Commits

Author SHA1 Message Date
21d2772440 Merge branch 'master' of https://github.com/mariadb-corporation/mariadb-connector-python 2022-03-25 06:23:50 +01:00
cf8c3f0652 Added missing test for CONPY-178 2022-03-25 06:23:14 +01:00
d2308f156a test xpand testing 2022-03-24 15:05:42 +01:00
2bad21412f Fix for CONPY-196:
When closing a cursor object, the reference for the corresponding
connection object must be decremented to prevent leakage.
2022-03-24 05:22:57 +01:00
b8386de8fd Skip test if we're connected to MySQL server 2022-02-20 14:35:43 +01:00
4aa46c955e tests for CONPY-194 2022-02-20 06:01:47 +01:00
d92d3545ef Renamed test
Previous commit mentioned Fix o CONPY-191 instead of
CONPY-193. Test renamed
2022-02-09 00:35:54 +01:00
4855a7b21d Fix for CONPY-191:
When connected to a database server which doesn't support bulk
execution, we need to set bind.is_null instead of changing the buffer
type to MYSQL_TYPE_NULL. This will keep the original buffer type.
2022-02-08 22:30:30 +01:00
7b63daa9c1 CONPY-188:
When a connection or cursor was closed, an exception will be returned
if a method or property of closed object will be called.
2022-01-18 21:07:10 +01:00
9a7e8fc8db test - skipping test for maxscale due to MXS-3921 bug 2021-12-17 16:27:12 +01:00
4649a72c51 correct benchmark, passing current TEST_MODULE, update benchmarks 2021-12-17 14:43:56 +01:00
0c6d7df851 test - change travis test to use common framework in order to set different server type 2021-12-16 19:40:21 +01:00
c90977316b Fix for CONPY-178:
When a cursor was not properly cleared (all results weren't
fetched) the clear_result routine has to free result sets only
if field_count > 0.
2021-11-25 06:01:18 +01:00
5ed872fb00 Fix for CONPY-175:
Since memory for stack allocation is limited, we need to allocate
memory from the heap, otherwise in case of large strings escape_string
method might crash.
2021-10-28 10:53:00 +02:00
9bb4e374ac CONPY-155: segmentation fault on calling connection.get_server_version()
Check if connection is still active and increment reference counter for
server_version.
2021-06-06 11:56:57 +02:00
8b5f9abb2e Fix for CONPY-150:
Since Python complains about invalid date types (year, month or day=0),
they need to converted to NULL instead of PyDate* object.
2021-04-06 11:21:38 +02:00
f633103914 Fix for CONC-139:
When using binary protocol, convert data to binary object only if the
character set is BINARY (63), not if the flag was set.
2021-02-14 15:29:58 +01:00
a1c709b0e8 Fix for CONPY-133:
Extended parser for supporting MariaDB comment syntax
(https://mariadb.com/kb/en/comment-syntax/)
2020-11-24 14:00:56 +01:00
35a12359b5 travis: disable bench 2020-11-23 09:31:20 +01:00
1ae8afb5cf MySQL test fix: use server side cursor for select only 2020-11-22 21:21:39 +01:00
26ca93492f Test fixes for testing against MySQL server 2020-11-18 16:42:35 +01:00
3ea9319728 Followup form last fix: remove BLOB or JSON check 2020-11-18 09:53:17 +01:00
76f01e8f5f Test fix:
MDEV-17832 (pluggable data types was added in MariaDB 10.5.2), so for
versions < 10.5.2 we need to check for data type BLOB instead of JSON.
2020-11-17 17:19:36 +01:00
a47d3e5d76 Implementation of CONPY-129:
Added connection attribute server_version_info and (for compatibiliry)
get_server_version() method.
Both return a tuple, describing the version number of connected server
in following format: (MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION)
2020-11-16 10:03:05 +01:00
020017ee33 Fix for CONPY123: Free pending result sets when closing cursor
When using text protocol pending result sets weren't properly freed,
so executing another command on the same connection resulted in an error
"commands out of sync".
2020-10-12 09:05:49 +02:00
3f95456824 CONPY-117: Added converter support
The connect() method now accepts an addtional parameter
converter which points to a dictionary, containing one or more conversions.
A conversion must be specified in the form {FIELD_TYOE : conversion_function}
2020-09-29 13:21:13 +02:00
5d4a8d5d62 Fix for CONPY-116: Wrong type reported for SQL type JSON
Beginning of MariaDB 10.5 metadata for JSON columns is stored
in extended field information, and the reported type is MYSQL_TYPE_BLOB.
We now check extended field information to return correct type and for
fetching values in correct format.
2020-09-29 11:43:47 +02:00
d860cac798 Fix test test_connection_default_file:
check if password was set in connection options before writing into
configuration file
2020-09-01 12:32:45 +02:00
424320b840 Test fixes for SkySQL 2020-09-01 07:39:15 +02:00
d9a5ee474b Travi fix for 10.1 test: error < 2 result in mariadb.OperationalError 2020-08-16 16:03:27 +02:00
837a36ea15 Fix rowcount calculation for emulated bulk operations 2020-08-16 15:10:26 +02:00
ffeb8b9e17 Fix exception type check for ed25512 plugin test 2020-08-16 13:02:35 +02:00
c2d96a9b9c Fix time tests: MYSQL_TYPE_TIME will be converted to datetime.timedelta now. 2020-08-16 12:01:26 +02:00
afea681910 Fix for CONPY-105: Change behavior of cursor->rowcount and cursor->lastrowid
rowcount:
In case of an error, or if statement wasn't executed rowcount should be -1 (see PEP-249)

    For DML statements the number of affected rows returned in OK packet by server:
        > 0 for DML statements which modify or insert, e.g. ALTER TABLE or CREATE TABLE .. SELECT FROM
        otherwise 0
    For DQL statement
        if field_count > 0: number of rows returned
        otherwise affected rows returned in OK packet by server.

lastrowid:

    if server returns no value (0) for last_insert_id, lastrowid should be None.
    if last_insert_id is > 0, return it's value
2020-08-14 16:44:13 +02:00
ab2553a9d8 Added test for CONPY-103 2020-08-12 14:59:30 +02:00
0e91d76d52 Fix for CONPY-102:
Fixed default behavior of autocommit: If not autocommit mode was specified,
autocommit will be off by default (see https://www.python.org/dev/peps/pep-0249/#commit).
Added new keyword autocommit for connection class which might have the following values:
- None: use server default setting
- True: turns autocommit on
- False: turns autocommit off
2020-08-12 14:19:02 +02:00
067a78dd13 Fix for CONPY68 (jsonfield returning as bytes):
When a value is returned as binary type (BLOB) but has a non binary collation,
it will be converted now as a unicode string and the binary flag will be ignored.
2020-08-10 14:59:16 +02:00
a749c53859 Fix for CONPY-98:
If a string has a binary collation/charset it needs to be converted
to a Binary instead of Unicode.
2020-08-07 14:45:50 +02:00
43211642cd Added test for CONPY-91 2020-08-07 12:42:32 +02:00
bfd71e2fa1 Fix for CONPY-94:
Don't check for exact type but also for subtype.
2020-08-06 15:03:48 +02:00
e3eba3abaf Added method pool.close() 2020-08-05 19:01:53 +02:00
a9fe837db7 Fixed connection test 2020-07-24 12:33:17 +02:00
29b05e3b09 Various fixes and changes for SQLAlchemy support:
- added a thin python wrapper around mariadb module
- added constansts under mariadb.constants (CLIENT, CURSOR, INDICATOR)
- bench and test are now in testing subdirectory
- updated documentation
2020-07-24 12:13:31 +02:00