Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
3.1.28, 3.3.15, 3.4.6
-
None
Description
When using the python connector I'm getting an InterfaceError raised when the statement plus parameters are the same or slightly greater than the size of the socket buffer (8192).
To reproduce:
import mariadb |
for x in range(8125, 8140): |
connection = mariadb.connection(user='root', database = 'test') |
cursor = connection.cursor() |
cursor.execute("CREATE TABLE IF NOT EXISTS `testing` (`text` MEDIUMTEXT)") |
try: |
cursor.execute("INSERT INTO testing (`text`) VALUES (?)", (' ' * x, )) |
except Exception as e: |
print(f" Bad at {x}: {e!r} raised") |
else: |
print(f"Good at {x}") |
Which will emit:
Good at 8125
|
Good at 8126
|
Good at 8127
|
Good at 8128
|
Good at 8129
|
Good at 8130
|
Bad at 8131: InterfaceError('') raised
|
Bad at 8132: InterfaceError('') raised
|
Bad at 8133: InterfaceError('') raised
|
Bad at 8134: InterfaceError('') raised
|
Good at 8135
|
Good at 8136
|
Good at 8137
|
Good at 8138
|
Good at 8139
|
Following the code in `gdb` and we are returning an error here: https://github.com/mariadb-corporation/mariadb-connector-c/blob/461a2c79ea63406065a6237bf1043a250099565d/libmariadb/mariadb_lib.c#L527 in the c connector but I'm not sure if the bug is with that code or how the python connector is calling it.
Attachments
Issue Links
- is duplicated by
-
CONPY-309 mariadb.InterfaceError:
-
- Closed
-