You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-08 14:02:17 +03:00
Fix for CONC-243:
ABI breakage: Revert parameter length from size_t to unsigned long. (affects mysql_stmt_prepare, mysql_real_query, mysql_send_query)
This commit is contained in:
@@ -248,7 +248,7 @@ int ma_simple_command(MYSQL *mysql,enum enum_server_command command, const char
|
||||
* function prototypes
|
||||
*/
|
||||
MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql);
|
||||
int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, size_t length);
|
||||
int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, unsigned long length);
|
||||
int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt);
|
||||
int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt);
|
||||
int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, unsigned int column, unsigned long offset);
|
||||
|
@@ -511,10 +511,10 @@ void STDCALL mysql_close(MYSQL *sock);
|
||||
int STDCALL mysql_select_db(MYSQL *mysql, const char *db);
|
||||
int STDCALL mysql_query(MYSQL *mysql, const char *q);
|
||||
int STDCALL mysql_send_query(MYSQL *mysql, const char *q,
|
||||
size_t length);
|
||||
unsigned long length);
|
||||
my_bool STDCALL mysql_read_query_result(MYSQL *mysql);
|
||||
int STDCALL mysql_real_query(MYSQL *mysql, const char *q,
|
||||
size_t length);
|
||||
unsigned long length);
|
||||
int STDCALL mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level);
|
||||
int STDCALL mysql_dump_debug_info(MYSQL *mysql);
|
||||
int STDCALL mysql_refresh(MYSQL *mysql,
|
||||
|
@@ -1944,7 +1944,7 @@ mysql_query(MYSQL *mysql, const char *query)
|
||||
*/
|
||||
|
||||
int STDCALL
|
||||
mysql_send_query(MYSQL* mysql, const char* query, size_t length)
|
||||
mysql_send_query(MYSQL* mysql, const char* query, unsigned long length)
|
||||
{
|
||||
return ma_simple_command(mysql, COM_QUERY, query, length, 1,0);
|
||||
}
|
||||
@@ -2141,11 +2141,11 @@ mysql_read_query_result(MYSQL *mysql)
|
||||
}
|
||||
|
||||
int STDCALL
|
||||
mysql_real_query(MYSQL *mysql, const char *query, size_t length)
|
||||
mysql_real_query(MYSQL *mysql, const char *query, unsigned long length)
|
||||
{
|
||||
my_bool skip_result= OPT_EXT_VAL(mysql, multi_command);
|
||||
|
||||
if (length == (size_t)-1)
|
||||
if (length == (unsigned long)-1)
|
||||
length= strlen(query);
|
||||
|
||||
free_old_query(mysql);
|
||||
|
@@ -1381,7 +1381,7 @@ int STDCALL mysql_stmt_warning_count(MYSQL_STMT *stmt)
|
||||
return stmt->upsert_status.warning_count;
|
||||
}
|
||||
|
||||
int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, size_t length)
|
||||
int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, unsigned long length)
|
||||
{
|
||||
MYSQL *mysql= stmt->mysql;
|
||||
int rc= 1;
|
||||
@@ -1393,8 +1393,8 @@ int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, size_t lengt
|
||||
return(1);
|
||||
}
|
||||
|
||||
if (length == (size_t) -1)
|
||||
length= strlen(query);
|
||||
if (length == (unsigned long) -1)
|
||||
length= (unsigned long)strlen(query);
|
||||
|
||||
/* clear flags */
|
||||
CLEAR_CLIENT_STMT_ERROR(stmt);
|
||||
|
@@ -25,6 +25,8 @@
|
||||
#define SC_IO_BUFFER_SIZE 0x4000
|
||||
#define MAX_SSL_ERR_LEN 100
|
||||
|
||||
extern FILE *dump_file;
|
||||
|
||||
#define SCHANNEL_PAYLOAD(A) (A).cbMaximumMessage + (A).cbHeader + (A).cbTrailer
|
||||
void ma_schannel_set_win_error(MARIADB_PVIO *pvio);
|
||||
|
||||
@@ -451,6 +453,8 @@ SECURITY_STATUS ma_schannel_handshake_loop(MARIADB_PVIO *pvio, my_bool InitialRe
|
||||
rc = SEC_E_INTERNAL_ERROR;
|
||||
break;
|
||||
}
|
||||
fprintf(dump_file, "\nServer (%d) - %ld bytes\n", pvio->mysql->thread_id, nbytes);
|
||||
fwrite(sctx->IoBuffer + cbIoBuffer, nBytes, 1, dump_file);
|
||||
cbData = (DWORD)nbytes;
|
||||
cbIoBuffer += cbData;
|
||||
}
|
||||
@@ -512,6 +516,8 @@ SECURITY_STATUS ma_schannel_handshake_loop(MARIADB_PVIO *pvio, my_bool InitialRe
|
||||
DeleteSecurityContext(&sctx->ctxt);
|
||||
return SEC_E_INTERNAL_ERROR;
|
||||
}
|
||||
fprintf(dump_file, "\nClient (%d) - %ld bytes\n", pvio->mysql->thread_id, nbytes);
|
||||
fwrite(OutBuffers.pvBuffer, nBytes, 1, dump_file);
|
||||
cbData= (DWORD)nbytes;
|
||||
/* Free output context buffer */
|
||||
FreeContextBuffer(OutBuffers.pvBuffer);
|
||||
@@ -655,6 +661,8 @@ SECURITY_STATUS ma_schannel_client_handshake(MARIADB_TLS *ctls)
|
||||
sRet= SEC_E_INTERNAL_ERROR;
|
||||
goto end;
|
||||
}
|
||||
fprintf(dump_file, "\nClient (%d) - %ld bytes\n", pvio->mysql->thread_id, nbytes);
|
||||
fwrite(BuffersOut.pvBuffer, nBytes, 1, dump_file);
|
||||
r = (DWORD)nbytes;
|
||||
}
|
||||
sRet= ma_schannel_handshake_loop(pvio, TRUE, &ExtraData);
|
||||
@@ -754,6 +762,8 @@ SECURITY_STATUS ma_schannel_read_decrypt(MARIADB_PVIO *pvio,
|
||||
// todo: error
|
||||
return SEC_E_INVALID_HANDLE;
|
||||
}
|
||||
fprintf(dump_file, "\nServer (%d) - %ld bytes\n", pvio->mysql->thread_id, nbytes);
|
||||
fwrite(sctx->IoBuffer + dwOffset, nBytes, 1, dump_file);
|
||||
dwOffset+= (DWORD)nbytes;
|
||||
|
||||
ZeroMemory(Buffers, sizeof(SecBuffer) * 4);
|
||||
|
@@ -549,7 +549,7 @@ static int test_mysql_insert_id(MYSQL *mysql)
|
||||
rc= mysql_query(mysql, "drop table t2");
|
||||
check_mysql_rc(rc, mysql);
|
||||
rc= mysql_query(mysql, "create table t2 (f1 int not null primary key "
|
||||
"auto_increment, f2 varchar(255), unique (f2)) engine=MyISAM");
|
||||
"auto_increment, f2 varchar(200), unique (f2)) engine=MyISAM");
|
||||
check_mysql_rc(rc, mysql);
|
||||
rc= mysql_query(mysql, "insert into t2 values (null,'e')");
|
||||
res= mysql_insert_id(mysql);
|
||||
|
@@ -704,12 +704,6 @@ static int test_wl4284_1(MYSQL *mysql)
|
||||
return SKIP;
|
||||
}
|
||||
|
||||
if (!rc)
|
||||
{
|
||||
diag("InnoDB Storage engine not available");
|
||||
return SKIP;
|
||||
}
|
||||
|
||||
/* set AUTOCOMMIT to OFF */
|
||||
rc= mysql_autocommit(mysql, FALSE);
|
||||
check_mysql_rc(rc, mysql);
|
||||
|
Reference in New Issue
Block a user