Commit Graph

100 Commits

Author SHA1 Message Date
afb3ccd778 Check return code of db_generate_bulk_request
When inserting data via parameter callback function, an error
will be raised.
2024-09-14 15:31:57 +02:00
e705d637ea Fix CONPY-283: Incorrect result format after cursor.scroll()
Since unsigned long is 32-bit under windows, row_number must
be defined as uint64_t, since we assign 64-bit values directly
from python code.
2024-03-18 10:03:57 +01:00
d672551c7d Fix for CONPY-277:
To avoid a syntax error when running under sql_mode ANSI_QUOTES
parameter substitution will be done by using single quotes instead
of double quotes.
2024-02-05 07:02:39 +01:00
b65fd443ee Fix of previous commit:
Skip test_conpy278 instead of test_conpy279.
2024-02-02 16:08:32 +01:00
7bc789a148 Skip test_conc279 when running with MaxScale
(see https://jira.mariadb.org/browse/MXS-4961)
2024-02-02 08:58:17 +01:00
8620d49f21 Fix for test_conpy279 2024-02-01 12:41:33 +01:00
d9e33de683 Fix for CONPY-281:
Run escape test with and without sql_mode NO_BACKSLASH_ESCAPES.
2024-02-01 07:10:29 +01:00
7c2134dddb Fix for CONPY-278:
In case of an (automatic) reconnect the connection property
connection_id was not updated, since there is no callback
functionality in Connector/C available to notify the application
that a reconnect occured. Instead of obtaining the connection_id
via MemberDef, connection_id is now implemented as getter function.
2024-01-31 17:21:48 +01:00
f00bc261d4 Fix for CONPY-279:
Allow None values for password and database in change_user()
method of connection object.
2024-01-30 15:55:34 +01:00
9952ff09af CONPY-276:
Allow to retrieve data from buffered cursor if the connection
was already closed.
2023-12-20 17:29:28 +01:00
7d6b5af51c [misc] correct CREATE OR REPLACE commands to DROP IF EXISTS + CREATE for mysql test compatibility - part 2 2023-12-17 21:38:47 +01:00
0c72aaec43 [misc] test correction not using temporary tables with mysql 8 2023-12-15 18:50:36 +01:00
5a3dd3da6b [misc] test correction 2023-12-15 14:53:14 +01:00
76a766141f [misc] test stability improvement for mysql server 2023-12-14 16:35:23 +01:00
ba6b6e9255 [misc] correct CREATE OR REPLACE commands to DROP IF EXISTS + CREATE for mysql test compatibility 2023-12-14 10:55:10 +01:00
80a722a4c7 [misc] test correction for maxscale 2023-12-13 18:29:08 +01:00
1762e9d458 Travis: Added Python-3.12 2023-10-12 06:01:00 +02:00
84e423295a Test fix
Skip extended field type test if server is MySQL
or MariaDB server version is < 10.10
2023-10-12 05:41:40 +02:00
cfe1d10702 CONPY-271: Added cursor.metadata property
Similiar to description property, this property returns
a dictionary with complete metadata.

The dictionary contains the following keys:
  - catalog:     catalog (always 'def')
  - schema:      current schema
  - field:       alias column name or if no alias was specified
                 column name
  - org_field:   original column name
  - table:       alias table name or if no alias was specified
                 table name
  - org_table:   original table name
  - type:        column type
  - charset:     character set (utf8mb4 or binary)
  - length:      The length of the column
  - max length:  The maximum length of the column
  - decimals:    The numer of decimals
  - flags:       Flags (flags are defined in constants.FIELD_FLAG)
  - ext_type:    Extended data type (types are defined in
                 constants.EXT_FIELD_TYPE)

This fixes also CONPY-270: Instead of checking BINARY_FLAG we now
check character set for binary object types.
2023-10-11 14:50:23 +02:00
05f4cede96 Fix typo 2023-09-30 17:40:00 +02:00
91ecc9e3bf Workaround for CONPY-269:
Even if PEP-249 permits operations on a closed cursor, we don't
raise an exception if the cursor or the underlying connection
was closed. Instead rowcount property will return -1.

This is a workaround for pandas, where rowcount will be checked
after the cursor was closed.
2023-09-29 10:34:30 +02:00
658cc0015c Fix for CONPY-256:
Fix indexing when moving a free connection to used connections
to avoid returning the same connection twice.

Kudos and thanks to G.Mech for reporting this bug and providing
the fix.
2023-04-11 09:05:07 +02:00
494d9513da Fix for CONPY-255:
If a connection pool can't return a connection (all connections in use)
a PoolError will be raised instead of returning None object.
2023-04-11 08:37:16 +02:00
6afeaa53d1 CONPY-258: Fixed ValueError exception if ZEROFILL flag is defined
For backwards compatibility PyLong_FromString interprets leading
zeros as octal value which will end up in a value error, if the
number contains 2 or more leading zeros.
2023-04-06 17:22:26 +02:00
3827ae32bd CONPY-253: Add new connection option tls_version
The connection method now offers the option of specifying
the version of the TLS protocol using tls_version:

connection = mariadb.connect(tls_protocol="TLSv1.2")
2023-03-25 15:22:31 +01:00
0c844879fd Fix for CONPY-251
Check if stmt was already initialized in cursor method
nextset().
2023-02-12 08:26:37 +01:00
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
37623b1928 Merge branch '1.1' of https://github.com/mariadb-corporation/mariadb-connector-python into 1.1 2022-10-07 08:48:54 +02:00
d70be504e3 Fix for CONPY-225:
Set value for affected_rows.
2022-10-07 08:47:48 +02:00
577be039f6 [misc] correcting benchmark using binary 2022-09-22 19:06:35 +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
cb238ceabc [misc] adding bulk benchmark 2022-09-21 11:44:19 +02:00
4c75199a75 [misc] MariaDB benchmark common test suite implementation
benchmark precision improved running on one thread only with at least 1000 warmup operations
2022-09-06 11:03:31 +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