Commit Graph

53 Commits

Author SHA1 Message Date
bd560c2bb9 Fix for CONPY-108 (memory leak):
- initialize datetime API only once per object file
- don't reparse same statement
2020-08-29 12:20:52 +02:00
e091edd549 Fix for CONPY-106
Check error number instead of SQL code for determine exception type.
2020-08-14 14:44:05 +02:00
588bc01cc0 Implementation for CONPY-100:
Add option binary for cursor. When set to true cursor will always try
to use the client/server binary protocol, even when no parameter were
passed to execute.
2020-08-12 16:05:29 +02:00
01053e0d4a Fix for CONPY-93:
When releasing the GIL we need to unblock/block in callback functions (mariadb_codecs.c)
2020-08-05 18:54:19 +02:00
ea8354bb8b Added internal members for client and server capabilities to
MrdbConnection class.
2020-06-18 10:23:56 +02:00
5631d6ed3f Fixed bug in pooling tests:
Paraneters in set_config() method have to be checked against the list of DSN keywords.
2020-06-17 08:59:31 +02:00
ed2695b68c Fix for CONPY-78:
Instead of checking the server version number if a specific feature
is supported, we need to check the server capability or extended
capability flag.
2020-06-15 10:13:26 +02:00
e58caef84c Fix for CONPY-67:
If no rows were fetched from an unbuffered cursor (resultset) rowcount
now returns -1 instead of 0.
2020-05-27 10:40:35 +02:00
7142bedc62 Fix for CONPY-66:
fixed typo in setup configuration for windows, which caused to link
dynamically against MySQL Connector/C.
2020-05-14 14:24:32 +02:00
e873f87fab CONPY-56: Support dictionary option in cursor class
Added optional boolean parameter 'dictionary' for cursor class.
When dictionary parameter was set to true, the fetch operations will
return rows from result set as Dict.
2020-04-14 06:25:25 +02:00
eb46aa83ba Windows build fix for __attribute__((unused)):
Undefine __attribute__() macro if compiler is not gnuc or clang.
2020-04-06 20:26:05 +02:00
fe95eb0dee CONPY-49: Added support for Decimal type
1) When retrieving data with column type MYSQL_TYPE_NEWDECIMAL C/Python
now loads the decimal module and converts data from string into Pythons
decimal.Decimal type.

2) Wnen sending a decimal.Decimal parameter, value will be converted to string
and send with type MYSQL_TYPE_NEWDECIMAL to server.
2020-04-05 22:01:17 +02:00
a992bf3568 Fix for CONPY-51:
When using a buffered cursor, we need to store the field_count inside
Mrdb_Cursor, since db.commit/rollback will overwrite/clear mysql->field_count
inside Connector/C.
2020-04-05 21:45:44 +02:00
083086b1dd Fix for CONPY-45:
When converting time or datetime values with microseconds, the
calculation was wrong, e.g. a millisecond value of .123 was converted
to .000123 instead of .123000. This was already fixed in C/C but not
in C/Python.
2020-03-25 18:11:02 +01:00
840de124bd - minor Documentatiion fixes
- fixed test cases using removed character set option
2020-02-18 16:11:29 +01:00
a5bdf2a0b4 Make code more PEP-7 compliant 2020-01-07 05:03:16 +01:00
ad07e971b8 Build fixes 2019-12-18 15:10:54 +01:00
55963c6071 Windows fixes:
- fixed build (malloc.h needs to be included for alloca)
- fixed failing test (using lowercase db name)
2019-12-16 09:13:23 +01:00
675223744b Build fixes for MacOSX 2019-12-04 17:11:37 +01:00
3b02464b63 Fixes for class ConnectionPool()
- added mutexes for thread safety
- when calling get_connection thread pool will now not return the next
  free connection, but the connection that was not used the longest time.
2019-12-01 05:47:19 +01:00
5163e1900d Fixed windows crash: When parsing s#, the length parameter must be
defined as Py_ssize_t
2019-11-27 09:26:28 +01:00
a160152903 Windows build fixes: configuration is now stored in site.cfg 2019-11-25 17:24:04 +01:00
628fc39cd0 Initial connection pool implementation 2019-11-24 12:45:32 +01:00
0b66a9f287 Added documentation for cursor class 2019-11-17 12:43:22 +01:00
89ea56d668 Implementation of CONPY-29: Support format and pyformat paramstyle
While the default paramstyle is still 'qmark', MariaDB Connector/Python
now also supports the paramstyles 'format' and 'pyformat'. The paramstyles
can't be mixed.
2019-11-14 09:21:57 +01:00
7a8922ad90 Fix for CONPY-28: crash when creating a cursor 2019-11-13 12:20:32 +01:00
a4648e992c Implemented CONPY-27: support prepared for cursor
Fixed line endings (dos2unix)
2019-11-13 11:45:02 +01:00
1b75fa2e7d Merge branch 'master' of https://github.com/MariaDB/mariadb-connector-python 2019-11-12 11:13:08 +01:00
0d565a6fb7 Added more documentation 2019-11-12 09:41:25 +01:00
88a27a10d7 [misc] Adding PY_SSIZE_T_CLEAN to handle python 3.8 parsing int deprecation 2019-11-06 15:16:29 +01:00
e2f51e072a Added documentation for module and connection 2019-10-31 07:35:34 +01:00
9a35790bac Added support for text protocol:
If the execution of a sql statement doesn't use parameters, we always use
text protocol instead of binary protocol.
2019-09-09 07:03:40 +02:00
273777c92c Windows build fixes 2019-08-29 12:06:29 +02:00
56b7a3a3b3 CONPY-21: Invalidate cursors if connection was dropped 2018-08-06 07:13:04 +02:00
6fc3f17008 CONPY-19: Added iterator support for cursor object 2018-08-04 17:32:59 +02:00
09a51f66ae Fixes for
- CONPY-15: executeMany fallback doesn't set lastrowid
- CONPY-14: execute_many_fallback doesn't set rowcount
2018-07-30 07:58:00 +02:00
c19b0f0404 Fix for CONPY-9 and CONPY-17:
description attribute is now implemented as getter function().
Changes:
- for strings length will now report the number of codepoints (instead) of bytes
- variable length datatypes will report -1 (packed len < 1).
- For floating point values (decimal, float, double) the values for precision and scale will be zero, in case the server sends decimals=31 (which means no precision/scale) was specified for the column.
2018-07-26 06:54:02 +02:00
c23b05f95d Save statement length 2018-07-25 08:59:59 +02:00
fdc607123e Added support for server_version and server_info attributes.
Minor fixes in setup.py
2018-07-24 10:09:55 +02:00
e41f0713ae CONPY-3:
New connection methods:
- autocommit
- ping
- kill
- reconnect
- escape_string
- reset
- change_user

New attributes:
- user (read only)
- database (read/write)
- connection_id (read only)
- warnings (read only)
- auto_reconnect (read/write)

New Cursor attribute:
- warnings (read only)
2018-07-22 17:58:35 +02:00
ae8020d709 Instead of storing pickled objects in a dynamic column, we store them
directly in BLOB. They will be identified in function mariadb_get_pickled()
under the following conditions:
- First two bytes must be 0x8003
- Last byte must be 0x2E
- the depickling call must return a valid (not NULL) object.
2018-07-20 17:03:39 +02:00
5994af2465 Objects with non corresponding database types (like tuple, list, ordereddict, set, ...) are now serialized (pickled) and stored in a dynamic column with key "pickle". 2018-07-20 13:23:22 +02:00
8dfc01cb65 Added support for PySet 2018-07-19 11:30:03 +02:00
18177c1e4c Added connection attributes
- server_name
- server_port
- user
- tls_cipher
- tls_version
- character_set
- collation
- unix_socket
- connection_id
2018-07-16 09:44:34 +02:00
fbfca48e0e Added support for indicators (executemany):
mariadb.indicator_null,
  mariadb.indicator_default,
  mariadb.indictor.ignore
Added support for Tuple and list objects:
  List and Tuple will be stored as blob in a dynamic column
2018-07-15 10:00:20 +02:00
5c0e659c9a - Added two phase commit support 2018-07-08 16:38:56 +02:00
24f4cc76de Added exception sets for connection object 2018-07-05 17:06:27 +02:00
9606a94eb4 Added
Binary
  Date
  Time
  Timestamp
  Changed description() to description (attribute instead of method)
2018-07-05 13:35:45 +02:00
0915fcb710 Added required DB API 2.0 (PEP-249) methods
- mariadb.DateFromTicks
- mariadb.TimeFromTicks
- mariadb.TimestampFromTicks
2018-07-03 09:10:26 +02:00
63cc34a229 Added dbapitype class 2018-07-03 06:42:08 +02:00