[CONC-243] ABI break : mysql_stmt_prepare uses size_t, not unsigned long for length Created: 2017-03-10  Updated: 2017-07-01  Resolved: 2017-07-01

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 3.0.1
Fix Version/s: 3.0.2

Type: Bug Priority: Major
Reporter: Vladislav Vaintroub Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None


 Description   

Connector C break the existing ABI on Win64, by changing parameter type for
mysql_stmt_prepare from 4 byte unsigned long to 8 byte size_t

Here is the definition of mysql_stmt_prepare
https://dev.mysql.com/doc/refman/5.7/en/mysql-stmt-prepare.html

int mysql_stmt_prepare(MYSQL_STMT *stmt, const char *stmt_str, unsigned long length)

here is how it looks like in C/C
int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, size_t length)

the immediate problem is that whenever anyone uses special value -1 in his program for the length, and uses mysql ABI, it is not understood correctly by C/C as -1

In 10.2, the server is still using its own mysql ABI-compatible copy of mysql.h (which is another big problem that need correction but I wont expand on it here).

These differences in headers, i.e in ABI, make a seemingly innocent patch like this one

https://github.com/MariaDB/server/commit/24cbc8dae3f94214a752c757fb82fc80faa1d864
fail with obscure error, here
http://buildbot.askmonty.org/buildbot/builders/winx64-debug/builds/2921

There is at least one more similar ABI break for mysql_stmt_send_long_data()


Generated at Thu Feb 08 03:03:54 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.