Commit Graph

69 Commits

Author SHA1 Message Date
9f7fcbb356 Fix for CONPY-250:
With implementation of CONPY-246/247 pool._connections was replaced
by _connections_used and _connections_free to the size should be
calclulated as len(_connections_used + _connections_free)
2023-02-08 16:04:20 +01:00
fad6119fd0 CONPY-248:
If a connection in connection pool was identified as broken (either
COM_PING or reset_connection failed) it will be replaced by a new
connection.
2023-02-05 14:22:46 +01:00
a48eb1eff6 Fix for CONPY-246:
Rollback transaction if connection pool was created with
pool_reset_connection=False.
2023-02-03 08:07:41 +01:00
7daab2feb5 Fix for CONPY-245:
Instead of iterating through all connections and checking the health
status via ping, used and unused connections were separated in different
lists. This ensures that the last used connection will be always the first.
2023-02-01 09:33:54 +01:00
ca7b5ae6fd [misc] adding pip install packaging to test + remove distutils use 2022-11-03 10:26:01 +01:00
80b642b8a1 Fix for CONPY-229:
Pass NULL/None values to converter.
2022-10-19 17:13:27 +02:00
ce228b68da CONPY-227: Replace collections.named_tuple
Replaced collections.named_tuple by C-Pythons PyStruct_Sequence.
All conversion are done now before fetching a row: converting to
other result types than tuple (named tuple or dict) now have less
overhead and are significantly faster.
2022-10-10 09:01:19 +02:00
d70be504e3 Fix for CONPY-225:
Set value for affected_rows.
2022-10-07 08:47:48 +02:00
37ea27cf86 Fix for CONPY-224:
If a bulk operation is executed and the statement doesn't need to
be reprepared, only array size has to be updated, since setting
the number of parameters (STMT_ATTR_PREBIND_PARAMS) will reset the
statement in Connector/C.
2022-09-22 07:26:46 +02:00
215d983df0 Fixed test name:
Last commit message was incorrect, issue fixed CONPY-222, not
CONPY-221 (which was already closed).
2022-08-27 07:39:50 +02:00
c3fe1a954e Fix for CONPY-221:
Removed __del__ method from cursors.py to prevent
raisiing if cursor was already properly closed via close()
method.
2022-08-27 07:25:09 +02:00
cdd42743cc Coding style fixes (PEP8)
Fixed various coding style stuff detected by flake8.
Added .pre-commit-config.yaml:
With command pre_commit install a hook for flake8 will be
installed.
2022-08-07 16:47:26 +02:00
205b9c2768 CONPY-218: Allow None as data parameter
Allow None as data parameter for cursors execute()
method.
Kudos to  Luciano Barcaro for providing a fix.
2022-07-21 05:46:53 +02:00
c30b597ba9 Fix for CONPY-213
Additionally to the fix for CONPY-214 (which fixed the iterator), we
need to check that converter will not be called with EOF (None).
2022-07-07 13:42:34 +02:00
275aaf3ee1 Fix for CONPY-214:
Replace cursor iterator by native python __iter__() method.
2022-07-06 22:57:58 +02:00
09e5cad2c0 Fix for CONPY-212
The default settiing for buffered in cursors.execute() method has
to be None:
- if not specified, it will use cursor defaults
- if specified, the default behavior of cursor will be changed
2022-06-29 15:09:20 +02:00
ba56c73a34 CONPY-209:
When executing cursor in text protocol, the substitution of
parameters with mb chars didn't set the correct length.
2022-06-29 12:29:38 +02:00
1b78f22a3c test fixes 2022-06-27 19:42:43 +02:00
d2f9780965 typos 2022-06-22 16:22:27 -05:00
5420fe39d9 Various fixes:
- removed utf8 part of parser, instead we use python binary
  object for parameter substituton (text mode)
- removed memory leaks
- fixed crash when reusing cursor with different number of
  placeholders
2022-06-08 13:43:20 +02:00
f23e4e9b83 CONPY-205: Added error constants
Error code constants are now defined in constants/ERR.
The file ERR.py is generated by helper/create_errconst.py
script, please don't edit it.
2022-05-25 18:54:11 +02:00
30c8f33b08 CONPY-205: Inconsistent exceptions
- All parameter exceptions are now ProgrammingErrors
- A dictionary now might contain more keys than
  placeholders in statement
- Fixed unhandled exception when using dictionary as parameter
2022-05-25 18:47:03 +02:00
0a7f751f68 Test fixes 2022-05-21 10:06:26 +02:00
f2fc6e8af6 test for CONPY-178 2022-03-25 06:30:23 +01:00
2e81925a3e Skip test if we are connected to MySQL server 2022-02-20 14:34:51 +01:00
ba1bce8b62 Added test for REPLACE RETURNING 2022-02-20 08:56:21 +01:00
f844622b51 Added test for CONPY-194 2022-02-20 05:03:43 +01:00
4bcfd6a58e CONPY-88
Extended cursor->description:

The descriptor now contains 11 elements:
descriptor[8]: table name
descriptor[9]: original column name
descriptor[10]: original table name
2022-01-25 05:35:45 +01:00
63c82019ab Check if client lib supports multi hosts
Since MariaDB Connector/C 3.3.0 host parameter may contain multiple hosts,
separated by a comma for simple failover. If MariaDB Connector/Python uses
a MariaDB Connector/C library < 3.3.0 an exception will be raised if host
parameter contains a comma.
2022-01-23 20:40:59 +01:00
811cc1c5f7 Check if object was closed:
When accessing methods or properties of connection and cursor objects
we now check if the object or parent object was closed and raise an
exception.
2022-01-16 20:59:58 +01:00
ae9cae91a6 test - skipping a maxscale bug 2021-12-17 15:56:06 +01:00
db3b6f555c test - change travis test to use common framework in order to set different server type
update benchmarks
2021-12-17 15:05:04 +01:00
eb48926845 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-11-02 11:15:51 +01:00
3184707494 Fix for CONPY-168
Force use of binary protocol if binary parameters
were provided.
2021-10-03 06:50:00 +02:00
0074295d75 Parser:
Added unicode support for statement parser
2021-10-02 15:52:42 +02:00
cfe3eee3b4 Fix for CONPY-167:
If executemany() is executed directly after execute() with the same
statement it needs to be reprepared.
2021-09-25 12:50:12 +02:00
fb175c734d Fix version test:
If patch number contains character (alpha) we need to comapre
strings instead of integers.
2021-09-13 08:58:22 +02:00
1ab9f833bf Test fix:
When connected against MySQL or MariaDB < 10.2 server
we need to skip tests which use INDICATOR variables,
since they can't be used in mysql_stmt_execute() C API
function.
2021-08-16 09:32:32 +02:00
47ca11d921 Documentation update 2021-08-01 10:31:10 +02:00
ebb09cf56e Documentation 2021-07-28 06:55:10 +02:00
2bd40ca1de Test fixes 2021-07-18 18:16:38 +02:00
8ee02ac7e3 Cursor fixes for execute, implemented execute_direct 2021-07-14 22:14:52 +02:00
feb990db4e Moved DBAPI 2.0 Date/Time/Timestamp constructors from C code to Python module dpapi20.py 2020-12-01 20:59:27 +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