diff --git a/include/mariadb_stmt.h b/include/mariadb_stmt.h index d29dce10..9c18c511 100644 --- a/include/mariadb_stmt.h +++ b/include/mariadb_stmt.h @@ -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); diff --git a/include/mysql.h b/include/mysql.h index ffa308f1..b5cb2e5e 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -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, diff --git a/libmariadb/mariadb_lib.c b/libmariadb/mariadb_lib.c index a945a439..8b4c1dc4 100644 --- a/libmariadb/mariadb_lib.c +++ b/libmariadb/mariadb_lib.c @@ -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); diff --git a/libmariadb/mariadb_stmt.c b/libmariadb/mariadb_stmt.c index 37d5d3d1..7fac4af4 100644 --- a/libmariadb/mariadb_stmt.c +++ b/libmariadb/mariadb_stmt.c @@ -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); diff --git a/libmariadb/secure/ma_schannel.c b/libmariadb/secure/ma_schannel.c index 5d9cfc6b..6c27cba6 100644 --- a/libmariadb/secure/ma_schannel.c +++ b/libmariadb/secure/ma_schannel.c @@ -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); diff --git a/unittest/libmariadb/basic-t.c b/unittest/libmariadb/basic-t.c index d6c80660..e05f7005 100644 --- a/unittest/libmariadb/basic-t.c +++ b/unittest/libmariadb/basic-t.c @@ -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); diff --git a/unittest/libmariadb/misc.c b/unittest/libmariadb/misc.c index 0a42df2a..28d33c0d 100644 --- a/unittest/libmariadb/misc.c +++ b/unittest/libmariadb/misc.c @@ -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);