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 Windows size_t warnings.
This commit is contained in:
@@ -2169,7 +2169,7 @@ mysql_real_query(MYSQL *mysql, const char *query, unsigned long length)
|
|||||||
my_bool skip_result= OPT_EXT_VAL(mysql, multi_command);
|
my_bool skip_result= OPT_EXT_VAL(mysql, multi_command);
|
||||||
|
|
||||||
if (length == (unsigned long)-1)
|
if (length == (unsigned long)-1)
|
||||||
length= strlen(query);
|
length= (unsigned long)strlen(query);
|
||||||
|
|
||||||
free_old_query(mysql);
|
free_old_query(mysql);
|
||||||
|
|
||||||
|
@@ -246,7 +246,7 @@ int mthd_stmt_read_all_rows(MYSQL_STMT *stmt)
|
|||||||
{
|
{
|
||||||
size_t len= MAX(stmt->fields[i].length, mysql_ps_fetch_functions[stmt->fields[i].type].max_len);
|
size_t len= MAX(stmt->fields[i].length, mysql_ps_fetch_functions[stmt->fields[i].type].max_len);
|
||||||
if (len > stmt->fields[i].max_length)
|
if (len > stmt->fields[i].max_length)
|
||||||
stmt->fields[i].max_length= len;
|
stmt->fields[i].max_length= (unsigned long)len;
|
||||||
}
|
}
|
||||||
else if (!stmt->fields[i].max_length)
|
else if (!stmt->fields[i].max_length)
|
||||||
{
|
{
|
||||||
@@ -2319,7 +2319,7 @@ int STDCALL mariadb_stmt_execute_direct(MYSQL_STMT *stmt,
|
|||||||
|
|
||||||
/* avoid sending close + prepare in 2 packets */
|
/* avoid sending close + prepare in 2 packets */
|
||||||
|
|
||||||
if ((rc= mysql_stmt_prepare(stmt, stmt_str, length)))
|
if ((rc= mysql_stmt_prepare(stmt, stmt_str, (unsigned long)length)))
|
||||||
return rc;
|
return rc;
|
||||||
return mysql_stmt_execute(stmt);
|
return mysql_stmt_execute(stmt);
|
||||||
}
|
}
|
||||||
|
@@ -487,11 +487,11 @@ int ma_tls_verify_server_cert(MARIADB_TLS *ctls)
|
|||||||
p1 = szName;
|
p1 = szName;
|
||||||
while (p1 && *p1 != 0)
|
while (p1 && *p1 != 0)
|
||||||
{
|
{
|
||||||
DWORD len = strlen(p1);
|
size_t len = strlen(p1);
|
||||||
/* check if given name contains wildcard */
|
/* check if given name contains wildcard */
|
||||||
if (len && *p1 == '*')
|
if (len && *p1 == '*')
|
||||||
{
|
{
|
||||||
DWORD hostlen = strlen(pszServerName);
|
size_t hostlen = strlen(pszServerName);
|
||||||
if (hostlen < len)
|
if (hostlen < len)
|
||||||
break;
|
break;
|
||||||
if (!stricmp(pszServerName + hostlen - len + 1, p1 + 1))
|
if (!stricmp(pszServerName + hostlen - len + 1, p1 + 1))
|
||||||
|
@@ -158,7 +158,7 @@ static int auth_sha256_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
|
|||||||
char passwd[MAX_PW_LEN];
|
char passwd[MAX_PW_LEN];
|
||||||
unsigned char rsa_enc_pw[MAX_PW_LEN];
|
unsigned char rsa_enc_pw[MAX_PW_LEN];
|
||||||
unsigned int rsa_size;
|
unsigned int rsa_size;
|
||||||
unsigned int pwlen, i;
|
DWORD pwlen, i;
|
||||||
|
|
||||||
#if defined(HAVE_OPENSSL)
|
#if defined(HAVE_OPENSSL)
|
||||||
RSA *pubkey= NULL;
|
RSA *pubkey= NULL;
|
||||||
@@ -187,7 +187,7 @@ static int auth_sha256_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
|
|||||||
/* if a tls session is active we need to send plain password */
|
/* if a tls session is active we need to send plain password */
|
||||||
if (mysql->client_flag & CLIENT_SSL)
|
if (mysql->client_flag & CLIENT_SSL)
|
||||||
{
|
{
|
||||||
if (vio->write_packet(vio, (unsigned char *)mysql->passwd, strlen(mysql->passwd) + 1))
|
if (vio->write_packet(vio, (unsigned char *)mysql->passwd, (int)strlen(mysql->passwd) + 1))
|
||||||
return CR_ERROR;
|
return CR_ERROR;
|
||||||
return CR_OK;
|
return CR_OK;
|
||||||
}
|
}
|
||||||
@@ -254,7 +254,7 @@ static int auth_sha256_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
|
|||||||
if (!pubkey)
|
if (!pubkey)
|
||||||
return CR_ERROR;
|
return CR_ERROR;
|
||||||
|
|
||||||
pwlen= strlen(mysql->passwd) + 1; /* include terminating zero */
|
pwlen= (DWORD)strlen(mysql->passwd) + 1; /* include terminating zero */
|
||||||
if (pwlen > MAX_PW_LEN)
|
if (pwlen > MAX_PW_LEN)
|
||||||
goto error;
|
goto error;
|
||||||
memcpy(passwd, mysql->passwd, pwlen);
|
memcpy(passwd, mysql->passwd, pwlen);
|
||||||
|
@@ -392,7 +392,7 @@ static int test_bad_union(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
FAIL_UNLESS(rc && mysql_errno(mysql) == 1222, "Error expected");
|
FAIL_UNLESS(rc && mysql_errno(mysql) == 1222, "Error expected");
|
||||||
|
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
|
@@ -69,7 +69,7 @@ static int bulk1(MYSQL *mysql)
|
|||||||
rc= mysql_query(mysql, "CREATE TABLE bulk1 (a int , b VARCHAR(255))");
|
rc= mysql_query(mysql, "CREATE TABLE bulk1 (a int , b VARCHAR(255))");
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_str, strlen(stmt_str));
|
rc= mysql_stmt_prepare(stmt, stmt_str, (unsigned long)strlen(stmt_str));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
/* allocate memory */
|
/* allocate memory */
|
||||||
|
@@ -169,20 +169,20 @@ static int test_conversion(MYSQL *mysql)
|
|||||||
ulong length;
|
ulong length;
|
||||||
|
|
||||||
stmt_text= "DROP TABLE IF EXISTS t1";
|
stmt_text= "DROP TABLE IF EXISTS t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
stmt_text= "CREATE TABLE t1 (a TEXT) DEFAULT CHARSET latin1";
|
stmt_text= "CREATE TABLE t1 (a TEXT) DEFAULT CHARSET latin1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
stmt_text= "SET character_set_connection=utf8, character_set_client=utf8, "
|
stmt_text= "SET character_set_connection=utf8, character_set_client=utf8, "
|
||||||
" character_set_results=latin1";
|
" character_set_results=latin1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
stmt_text= "INSERT INTO t1 (a) VALUES (?)";
|
stmt_text= "INSERT INTO t1 (a) VALUES (?)";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(my_bind, '\0', sizeof(my_bind));
|
memset(my_bind, '\0', sizeof(my_bind));
|
||||||
@@ -200,7 +200,7 @@ static int test_conversion(MYSQL *mysql)
|
|||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
stmt_text= "SELECT a FROM t1";
|
stmt_text= "SELECT a FROM t1";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -217,10 +217,10 @@ static int test_conversion(MYSQL *mysql)
|
|||||||
|
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
stmt_text= "DROP TABLE t1";
|
stmt_text= "DROP TABLE t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
stmt_text= "SET NAMES DEFAULT";
|
stmt_text= "SET NAMES DEFAULT";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
@@ -299,7 +299,7 @@ static int test_ps_i18n(MYSQL *mysql)
|
|||||||
ulong buf1_len, buf2_len;
|
ulong buf1_len, buf2_len;
|
||||||
|
|
||||||
stmt_text= "DROP TABLE IF EXISTS t1";
|
stmt_text= "DROP TABLE IF EXISTS t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -309,14 +309,14 @@ static int test_ps_i18n(MYSQL *mysql)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
stmt_text= "CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))";
|
stmt_text= "CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "SET CHARACTER_SET_CLIENT=koi8r, "
|
stmt_text= "SET CHARACTER_SET_CLIENT=koi8r, "
|
||||||
"CHARACTER_SET_CONNECTION=cp1251, "
|
"CHARACTER_SET_CONNECTION=cp1251, "
|
||||||
"CHARACTER_SET_RESULTS=koi8r";
|
"CHARACTER_SET_RESULTS=koi8r";
|
||||||
|
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
memset(bind_array, '\0', sizeof(bind_array));
|
memset(bind_array, '\0', sizeof(bind_array));
|
||||||
@@ -333,7 +333,7 @@ static int test_ps_i18n(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt_text= "INSERT INTO t1 (c1, c2) VALUES (?, ?)";
|
stmt_text= "INSERT INTO t1 (c1, c2) VALUES (?, ?)";
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
mysql_stmt_bind_param(stmt, bind_array);
|
mysql_stmt_bind_param(stmt, bind_array);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -345,7 +345,7 @@ static int test_ps_i18n(MYSQL *mysql)
|
|||||||
stmt_text= "SELECT c1, c2 FROM t1";
|
stmt_text= "SELECT c1, c2 FROM t1";
|
||||||
|
|
||||||
/* c1 and c2 are binary so no conversion will be done on select */
|
/* c1 and c2 are binary so no conversion will be done on select */
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -370,7 +370,7 @@ static int test_ps_i18n(MYSQL *mysql)
|
|||||||
FAIL_UNLESS(rc == MYSQL_NO_DATA, "rc != MYSQL_NO_DATA");
|
FAIL_UNLESS(rc == MYSQL_NO_DATA, "rc != MYSQL_NO_DATA");
|
||||||
|
|
||||||
stmt_text= "DROP TABLE IF EXISTS t1";
|
stmt_text= "DROP TABLE IF EXISTS t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -383,12 +383,12 @@ static int test_ps_i18n(MYSQL *mysql)
|
|||||||
stmt_text= "CREATE TABLE t1 (c1 VARCHAR(255) CHARACTER SET cp1251, "
|
stmt_text= "CREATE TABLE t1 (c1 VARCHAR(255) CHARACTER SET cp1251, "
|
||||||
"c2 VARCHAR(255) CHARACTER SET cp1251)";
|
"c2 VARCHAR(255) CHARACTER SET cp1251)";
|
||||||
|
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "INSERT INTO t1 (c1, c2) VALUES (?, ?)";
|
stmt_text= "INSERT INTO t1 (c1, c2) VALUES (?, ?)";
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
/* this data must be converted */
|
/* this data must be converted */
|
||||||
bind_array[0].buffer_type= MYSQL_TYPE_STRING;
|
bind_array[0].buffer_type= MYSQL_TYPE_STRING;
|
||||||
@@ -425,7 +425,7 @@ static int test_ps_i18n(MYSQL *mysql)
|
|||||||
stmt_text= "SELECT c1, c2 FROM t1";
|
stmt_text= "SELECT c1, c2 FROM t1";
|
||||||
|
|
||||||
/* c1 and c2 are binary so no conversion will be done on select */
|
/* c1 and c2 are binary so no conversion will be done on select */
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -450,10 +450,10 @@ static int test_ps_i18n(MYSQL *mysql)
|
|||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
|
|
||||||
stmt_text= "DROP TABLE t1";
|
stmt_text= "DROP TABLE t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
stmt_text= "SET NAMES DEFAULT";
|
stmt_text= "SET NAMES DEFAULT";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@@ -700,7 +700,7 @@ static int test_utf16_utf32_noboms(MYSQL *mysql __attribute__((unused)))
|
|||||||
|
|
||||||
if (memcmp(buffer, in_string[UTF8], rc) != 0)
|
if (memcmp(buffer, in_string[UTF8], rc) != 0)
|
||||||
{
|
{
|
||||||
mysql_hex_string(as_hex, buffer, rc);
|
mysql_hex_string(as_hex, buffer, (unsigned long)rc);
|
||||||
diag("Converted string(%s) does not match the expected one", as_hex);
|
diag("Converted string(%s) does not match the expected one", as_hex);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
@@ -717,7 +717,7 @@ static int test_utf16_utf32_noboms(MYSQL *mysql __attribute__((unused)))
|
|||||||
|
|
||||||
if (memcmp(buffer, in_string[i], rc) != 0)
|
if (memcmp(buffer, in_string[i], rc) != 0)
|
||||||
{
|
{
|
||||||
mysql_hex_string(as_hex, buffer, rc);
|
mysql_hex_string(as_hex, buffer, (unsigned long)rc);
|
||||||
diag("Converted string(%s) does not match the expected one", as_hex);
|
diag("Converted string(%s) does not match the expected one", as_hex);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
@@ -45,7 +45,7 @@ MYSQL_STMT *open_cursor(MYSQL *mysql, const char *query)
|
|||||||
const ulong type= (ulong)CURSOR_TYPE_READ_ONLY;
|
const ulong type= (ulong)CURSOR_TYPE_READ_ONLY;
|
||||||
|
|
||||||
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
|
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
if (rc) {
|
if (rc) {
|
||||||
diag("Error: %s", mysql_stmt_error(stmt));
|
diag("Error: %s", mysql_stmt_error(stmt));
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -73,7 +73,7 @@ int stmt_fetch_init(MYSQL *mysql, Stmt_fetch *fetch, unsigned int stmt_no_arg,
|
|||||||
|
|
||||||
fetch->handle= mysql_stmt_init(mysql);
|
fetch->handle= mysql_stmt_init(mysql);
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(fetch->handle, fetch->query, strlen(fetch->query));
|
rc= mysql_stmt_prepare(fetch->handle, fetch->query, (unsigned long)strlen(fetch->query));
|
||||||
FAIL_IF(rc, mysql_stmt_error(fetch->handle));
|
FAIL_IF(rc, mysql_stmt_error(fetch->handle));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -359,7 +359,7 @@ static int test_bug10729(MYSQL *mysql)
|
|||||||
rc= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*) &type);
|
rc= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*) &type);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
stmt_text= "select name from t1";
|
stmt_text= "select name from t1";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(my_bind, '\0', sizeof(my_bind));
|
memset(my_bind, '\0', sizeof(my_bind));
|
||||||
@@ -415,7 +415,7 @@ static int test_bug10736(MYSQL *mysql)
|
|||||||
rc= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*) &type);
|
rc= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*) &type);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
stmt_text= "select name from t1 where name=(select name from t1 where id=2)";
|
stmt_text= "select name from t1 where name=(select name from t1 where id=2)";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(my_bind, '\0', sizeof(my_bind));
|
memset(my_bind, '\0', sizeof(my_bind));
|
||||||
@@ -463,7 +463,7 @@ static int test_bug10794(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
stmt_text= "insert into t1 (id, name) values (?, ?)";
|
stmt_text= "insert into t1 (id, name) values (?, ?)";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(my_bind, '\0', sizeof(my_bind));
|
memset(my_bind, '\0', sizeof(my_bind));
|
||||||
@@ -483,7 +483,7 @@ static int test_bug10794(MYSQL *mysql)
|
|||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
}
|
}
|
||||||
stmt_text= "select name from t1";
|
stmt_text= "select name from t1";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
type= (ulong) CURSOR_TYPE_READ_ONLY;
|
type= (ulong) CURSOR_TYPE_READ_ONLY;
|
||||||
mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type);
|
mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type);
|
||||||
stmt1= mysql_stmt_init(mysql);
|
stmt1= mysql_stmt_init(mysql);
|
||||||
@@ -503,7 +503,7 @@ static int test_bug10794(MYSQL *mysql)
|
|||||||
mysql_stmt_free_result(stmt);
|
mysql_stmt_free_result(stmt);
|
||||||
mysql_stmt_reset(stmt);
|
mysql_stmt_reset(stmt);
|
||||||
stmt_text= "select name from t1 where id=10";
|
stmt_text= "select name from t1 where id=10";
|
||||||
rc= mysql_stmt_prepare(stmt1, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt1, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt1);
|
check_stmt_rc(rc, stmt1);
|
||||||
rc= mysql_stmt_bind_result(stmt1, my_bind);
|
rc= mysql_stmt_bind_result(stmt1, my_bind);
|
||||||
check_stmt_rc(rc, stmt1);
|
check_stmt_rc(rc, stmt1);
|
||||||
@@ -568,7 +568,7 @@ static int test_bug10760(MYSQL *mysql)
|
|||||||
con1: insert into t1 (id) values (1)
|
con1: insert into t1 (id) values (1)
|
||||||
*/
|
*/
|
||||||
stmt_text= "select id from t1 order by 1";
|
stmt_text= "select id from t1 order by 1";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);;
|
check_stmt_rc(rc, stmt);;
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);;
|
check_stmt_rc(rc, stmt);;
|
||||||
@@ -594,7 +594,7 @@ static int test_bug10760(MYSQL *mysql)
|
|||||||
if (check_variable(mysql, "@@have_innodb", "YES"))
|
if (check_variable(mysql, "@@have_innodb", "YES"))
|
||||||
{
|
{
|
||||||
stmt_text= "select id from t1 order by 1";
|
stmt_text= "select id from t1 order by 1";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);;
|
check_stmt_rc(rc, stmt);;
|
||||||
|
|
||||||
rc= mysql_query(mysql, "alter table t1 engine=InnoDB");
|
rc= mysql_query(mysql, "alter table t1 engine=InnoDB");
|
||||||
@@ -648,7 +648,7 @@ static int test_bug11172(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
stmt_text= "SELECT id, hired FROM t1 WHERE hired=?";
|
stmt_text= "SELECT id, hired FROM t1 WHERE hired=?";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
type= (ulong) CURSOR_TYPE_READ_ONLY;
|
type= (ulong) CURSOR_TYPE_READ_ONLY;
|
||||||
@@ -716,7 +716,7 @@ static int test_bug11656(MYSQL *mysql)
|
|||||||
"where server in (?, ?)";
|
"where server in (?, ?)";
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
type= (ulong) CURSOR_TYPE_READ_ONLY;
|
type= (ulong) CURSOR_TYPE_READ_ONLY;
|
||||||
mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type);
|
mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type);
|
||||||
@@ -761,7 +761,7 @@ static int test_bug11901(MYSQL *mysql)
|
|||||||
|
|
||||||
|
|
||||||
stmt_text= "drop table if exists t1, t2";
|
stmt_text= "drop table if exists t1, t2";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "create table t1 ("
|
stmt_text= "create table t1 ("
|
||||||
@@ -771,7 +771,7 @@ static int test_bug11901(MYSQL *mysql)
|
|||||||
" bonus float not null, primary key (empno), "
|
" bonus float not null, primary key (empno), "
|
||||||
" unique key (workdept, empno) "
|
" unique key (workdept, empno) "
|
||||||
") default charset=latin1 collate=latin1_bin";
|
") default charset=latin1 collate=latin1_bin";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "insert into t1 values "
|
stmt_text= "insert into t1 values "
|
||||||
@@ -808,7 +808,7 @@ static int test_bug11901(MYSQL *mysql)
|
|||||||
"(330, 'WING', '', 'LEE', 'E21', 25370, 500), "
|
"(330, 'WING', '', 'LEE', 'E21', 25370, 500), "
|
||||||
"(340, 'JASON', 'R', 'GOUNOT', 'E21', 23840, 500)";
|
"(340, 'JASON', 'R', 'GOUNOT', 'E21', 23840, 500)";
|
||||||
|
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "create table t2 ("
|
stmt_text= "create table t2 ("
|
||||||
@@ -817,7 +817,7 @@ static int test_bug11901(MYSQL *mysql)
|
|||||||
" admrdept varchar(6) not null, refcntd int(11) not null,"
|
" admrdept varchar(6) not null, refcntd int(11) not null,"
|
||||||
" refcntu int(11) not null, primary key (deptno)"
|
" refcntu int(11) not null, primary key (deptno)"
|
||||||
") default charset=latin1 collate=latin1_bin";
|
") default charset=latin1 collate=latin1_bin";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "insert into t2 values "
|
stmt_text= "insert into t2 values "
|
||||||
@@ -830,7 +830,7 @@ static int test_bug11901(MYSQL *mysql)
|
|||||||
"('E01', 'SUPPORT SERVICES', 50, '', 'A00', 0, 0), "
|
"('E01', 'SUPPORT SERVICES', 50, '', 'A00', 0, 0), "
|
||||||
"('E11', 'OPERATIONS', 90, '', 'E01', 0, 0), "
|
"('E11', 'OPERATIONS', 90, '', 'E01', 0, 0), "
|
||||||
"('E21', 'SOFTWARE SUPPORT', 100,'', 'E01', 0, 0)";
|
"('E21', 'SOFTWARE SUPPORT', 100,'', 'E01', 0, 0)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "select t1.empno, t1.workdept "
|
stmt_text= "select t1.empno, t1.workdept "
|
||||||
@@ -842,7 +842,7 @@ static int test_bug11901(MYSQL *mysql)
|
|||||||
"order by 1";
|
"order by 1";
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*) &type);
|
mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*) &type);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -907,7 +907,7 @@ static int test_bug11904(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt_text= "SELECT id, MIN(name) FROM bug11904b GROUP BY id ORDER BY id";
|
stmt_text= "SELECT id, MIN(name) FROM bug11904b GROUP BY id ORDER BY id";
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt1, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt1, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt1);
|
check_stmt_rc(rc, stmt1);
|
||||||
|
|
||||||
memset(my_bind, 0, sizeof(my_bind));
|
memset(my_bind, 0, sizeof(my_bind));
|
||||||
@@ -986,14 +986,14 @@ static int test_bug12243(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt_text= "select a from t1";
|
stmt_text= "select a from t1";
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt1, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt1, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt1);
|
check_stmt_rc(rc, stmt1);
|
||||||
rc= mysql_stmt_execute(stmt1);
|
rc= mysql_stmt_execute(stmt1);
|
||||||
check_stmt_rc(rc, stmt1);
|
check_stmt_rc(rc, stmt1);
|
||||||
rc= mysql_stmt_fetch(stmt1);
|
rc= mysql_stmt_fetch(stmt1);
|
||||||
check_stmt_rc(rc, stmt1);
|
check_stmt_rc(rc, stmt1);
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt2, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt2, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt2);
|
check_stmt_rc(rc, stmt2);
|
||||||
rc= mysql_stmt_execute(stmt2);
|
rc= mysql_stmt_execute(stmt2);
|
||||||
check_stmt_rc(rc, stmt2);
|
check_stmt_rc(rc, stmt2);
|
||||||
@@ -1032,7 +1032,7 @@ static int test_bug11909(MYSQL *mysql)
|
|||||||
|
|
||||||
|
|
||||||
stmt_text= "drop table if exists t1";
|
stmt_text= "drop table if exists t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "create table t1 ("
|
stmt_text= "create table t1 ("
|
||||||
@@ -1041,7 +1041,7 @@ static int test_bug11909(MYSQL *mysql)
|
|||||||
" workdept varchar(6) not null, salary double not null,"
|
" workdept varchar(6) not null, salary double not null,"
|
||||||
" bonus float not null, primary key (empno)"
|
" bonus float not null, primary key (empno)"
|
||||||
") default charset=latin1 collate=latin1_bin";
|
") default charset=latin1 collate=latin1_bin";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "insert into t1 values "
|
stmt_text= "insert into t1 values "
|
||||||
@@ -1050,7 +1050,7 @@ static int test_bug11909(MYSQL *mysql)
|
|||||||
"(30, 'SALLY', 'A', 'KWAN', 'C01', 38250, 800),"
|
"(30, 'SALLY', 'A', 'KWAN', 'C01', 38250, 800),"
|
||||||
"(50, 'JOHN', 'B', 'GEYER', 'E01', 40175, 800), "
|
"(50, 'JOHN', 'B', 'GEYER', 'E01', 40175, 800), "
|
||||||
"(60, 'IRVING', 'F', 'STERN', 'D11', 32250, 500)";
|
"(60, 'IRVING', 'F', 'STERN', 'D11', 32250, 500)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
/* ****** Begin of trace ****** */
|
/* ****** Begin of trace ****** */
|
||||||
@@ -1059,7 +1059,7 @@ static int test_bug11909(MYSQL *mysql)
|
|||||||
"workdept, salary, bonus FROM t1 ORDER BY empno";
|
"workdept, salary, bonus FROM t1 ORDER BY empno";
|
||||||
stmt1= mysql_stmt_init(mysql);
|
stmt1= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt1, mysql_error(mysql));
|
FAIL_IF(!stmt1, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt1, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt1, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt1);
|
check_stmt_rc(rc, stmt1);
|
||||||
mysql_stmt_attr_set(stmt1, STMT_ATTR_CURSOR_TYPE,
|
mysql_stmt_attr_set(stmt1, STMT_ATTR_CURSOR_TYPE,
|
||||||
(const void*) &type);
|
(const void*) &type);
|
||||||
@@ -1112,7 +1112,7 @@ static int test_bug11909(MYSQL *mysql)
|
|||||||
stmt_text = "SELECT empno, firstname FROM t1";
|
stmt_text = "SELECT empno, firstname FROM t1";
|
||||||
stmt2= mysql_stmt_init(mysql);
|
stmt2= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt2, mysql_error(mysql));
|
FAIL_IF(!stmt2, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt2, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt2, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt2);
|
check_stmt_rc(rc, stmt2);
|
||||||
mysql_stmt_attr_set(stmt2, STMT_ATTR_CURSOR_TYPE,
|
mysql_stmt_attr_set(stmt2, STMT_ATTR_CURSOR_TYPE,
|
||||||
(const void*) &type);
|
(const void*) &type);
|
||||||
@@ -1185,7 +1185,7 @@ static int test_bug13488(MYSQL *mysql)
|
|||||||
rc= mysql_stmt_attr_set(stmt1,STMT_ATTR_CURSOR_TYPE, (const void *)&type);
|
rc= mysql_stmt_attr_set(stmt1,STMT_ATTR_CURSOR_TYPE, (const void *)&type);
|
||||||
check_stmt_rc(rc, stmt1);
|
check_stmt_rc(rc, stmt1);
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt1, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt1, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt1);
|
check_stmt_rc(rc, stmt1);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt1);
|
rc= mysql_stmt_execute(stmt1);
|
||||||
@@ -1240,7 +1240,7 @@ static int test_bug13524(MYSQL *mysql)
|
|||||||
rc= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type);
|
rc= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -1300,7 +1300,7 @@ static int test_bug14845(MYSQL *mysql)
|
|||||||
rc= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type);
|
rc= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -1357,7 +1357,7 @@ static int test_bug14210(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt_text= "select a from t1";
|
stmt_text= "select a from t1";
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
while ((rc= mysql_stmt_fetch(stmt)) == 0);
|
while ((rc= mysql_stmt_fetch(stmt)) == 0);
|
||||||
@@ -1497,7 +1497,7 @@ static int test_bug38486(MYSQL *mysql)
|
|||||||
rc= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type);
|
rc= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
stmt_text= "CREATE TABLE t1 (a INT)";
|
stmt_text= "CREATE TABLE t1 (a INT)";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
@@ -1506,7 +1506,7 @@ static int test_bug38486(MYSQL *mysql)
|
|||||||
rc= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type);
|
rc= mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
stmt_text= "INSERT INTO t1 VALUES (1)";
|
stmt_text= "INSERT INTO t1 VALUES (1)";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -1558,7 +1558,7 @@ static int test_bug9159(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void *)&type);
|
mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void *)&type);
|
||||||
|
|
||||||
mysql_stmt_execute(stmt);
|
mysql_stmt_execute(stmt);
|
||||||
@@ -1775,7 +1775,7 @@ static int test_bug9643(MYSQL *mysql)
|
|||||||
(void*) &prefetch_rows);
|
(void*) &prefetch_rows);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
stmt_text= "select * from t1";
|
stmt_text= "select * from t1";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(my_bind, '\0', sizeof(my_bind));
|
memset(my_bind, '\0', sizeof(my_bind));
|
||||||
|
@@ -50,7 +50,7 @@ static int test_ps_client_warnings(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query,(unsigned long)strlen(query));
|
||||||
FAIL_IF(rc, mysql_stmt_error(stmt));
|
FAIL_IF(rc, mysql_stmt_error(stmt));
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -115,7 +115,7 @@ static int test_ps_client_errors(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query,(unsigned long)strlen(query));
|
||||||
FAIL_IF(rc, mysql_stmt_error(stmt));
|
FAIL_IF(rc, mysql_stmt_error(stmt));
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -247,7 +247,7 @@ static int test_parse_error_and_bad_length(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "SHOW DATABAAAA", strlen("SHOW DATABAAAA"));
|
rc= mysql_stmt_prepare(stmt, "SHOW DATABAAAA", (unsigned long)strlen("SHOW DATABAAAA"));
|
||||||
FAIL_IF(!rc, "Error expected");
|
FAIL_IF(!rc, "Error expected");
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
|
@@ -46,7 +46,7 @@ static int bind_fetch(MYSQL *mysql, int row_count)
|
|||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
|
|
||||||
strcpy(query, "INSERT INTO test_bind_fetch VALUES (?, ?, ?, ?, ?, ?, ?)");
|
strcpy(query, "INSERT INTO test_bind_fetch VALUES (?, ?, ?, ?, ?, ?, ?)");
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc,stmt);
|
check_stmt_rc(rc,stmt);
|
||||||
|
|
||||||
FAIL_UNLESS(mysql_stmt_param_count(stmt) == 7, "ParamCount != 7");
|
FAIL_UNLESS(mysql_stmt_param_count(stmt) == 7, "ParamCount != 7");
|
||||||
@@ -85,7 +85,7 @@ static int bind_fetch(MYSQL *mysql, int row_count)
|
|||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
|
|
||||||
strcpy(query, "SELECT * FROM test_bind_fetch");
|
strcpy(query, "SELECT * FROM test_bind_fetch");
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc,stmt);
|
check_stmt_rc(rc,stmt);
|
||||||
|
|
||||||
for (i= 0; i < (int) array_elements(my_bind); i++)
|
for (i= 0; i < (int) array_elements(my_bind); i++)
|
||||||
@@ -199,7 +199,7 @@ static int test_fetch_seek(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc,stmt);
|
check_stmt_rc(rc,stmt);
|
||||||
|
|
||||||
memset(my_bind, '\0', sizeof(my_bind));
|
memset(my_bind, '\0', sizeof(my_bind));
|
||||||
@@ -286,7 +286,7 @@ static int test_fetch_offset(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)(unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc,stmt);
|
check_stmt_rc(rc,stmt);
|
||||||
|
|
||||||
memset(my_bind, '\0', sizeof(my_bind));
|
memset(my_bind, '\0', sizeof(my_bind));
|
||||||
@@ -408,7 +408,7 @@ static int test_fetch_column(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc,stmt);
|
check_stmt_rc(rc,stmt);
|
||||||
|
|
||||||
memset(my_bind, '\0', sizeof(my_bind));
|
memset(my_bind, '\0', sizeof(my_bind));
|
||||||
@@ -521,7 +521,7 @@ static int test_fetch_nobuffs(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt = mysql_stmt_init(mysql);
|
stmt = mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -612,7 +612,7 @@ static int test_fetch_null(MYSQL *mysql)
|
|||||||
stmt = mysql_stmt_init(mysql);
|
stmt = mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_bind_result(stmt, my_bind);
|
rc= mysql_stmt_bind_result(stmt, my_bind);
|
||||||
@@ -728,7 +728,7 @@ static int test_fetch_date(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_bind_result(stmt, my_bind);
|
rc= mysql_stmt_bind_result(stmt, my_bind);
|
||||||
|
@@ -78,7 +78,7 @@ static int test_logs(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, data, strlen(data));
|
rc= mysql_stmt_prepare(stmt, data, (unsigned long)strlen(data));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(my_bind, '\0', sizeof(my_bind));
|
memset(my_bind, '\0', sizeof(my_bind));
|
||||||
@@ -129,7 +129,7 @@ static int test_logs(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, data, strlen(data));
|
rc= mysql_stmt_prepare(stmt, data, (unsigned long)strlen(data));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -144,7 +144,7 @@ static int test_logs(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, data, strlen(data));
|
rc= mysql_stmt_prepare(stmt, data, (unsigned long)strlen(data));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_bind_param(stmt, my_bind);
|
rc= mysql_stmt_bind_param(stmt, my_bind);
|
||||||
|
@@ -244,7 +244,7 @@ static int test_frm_bug(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "show variables like 'datadir'", strlen("show variables like 'datadir'"));
|
rc= mysql_stmt_prepare(stmt, "show variables like 'datadir'", (unsigned long)strlen("show variables like 'datadir'"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -337,7 +337,7 @@ static int test_wl4166_1(MYSQL *mysql)
|
|||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
query= "INSERT INTO table_4166(col1, col2, col3, col4, col5, col6, col7) "
|
query= "INSERT INTO table_4166(col1, col2, col3, col4, col5, col6, col7) "
|
||||||
"VALUES(?, ?, ?, ?, ?, ?, ?)";
|
"VALUES(?, ?, ?, ?, ?, ?, ?)";
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 7, "param_count != 7");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 7, "param_count != 7");
|
||||||
@@ -449,7 +449,7 @@ static int test_wl4166_2(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "select * from t1", strlen("select * from t1"));
|
rc= mysql_stmt_prepare(stmt, "select * from t1", (unsigned long)strlen("select * from t1"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(bind_out, '\0', sizeof(bind_out));
|
memset(bind_out, '\0', sizeof(bind_out));
|
||||||
@@ -548,7 +548,7 @@ static int test_wl4166_3(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "insert into t1 (year) values (?)", strlen("insert into t1 (year) values (?)"));
|
rc= mysql_stmt_prepare(stmt, "insert into t1 (year) values (?)", (unsigned long)strlen("insert into t1 (year) values (?)"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "param_count != 1");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "param_count != 1");
|
||||||
@@ -640,12 +640,12 @@ static int test_wl4166_4(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt_text= "insert into t1 (c1, c2) values (?, ?)";
|
stmt_text= "insert into t1 (c1, c2) values (?, ?)";
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
mysql_stmt_bind_param(stmt, bind_array);
|
mysql_stmt_bind_param(stmt, bind_array);
|
||||||
|
|
||||||
mysql_stmt_send_long_data(stmt, 0, koi8, strlen(koi8));
|
mysql_stmt_send_long_data(stmt, 0, koi8, (unsigned long)strlen(koi8));
|
||||||
|
|
||||||
/* Cause a reprepare at statement execute */
|
/* Cause a reprepare at statement execute */
|
||||||
rc= mysql_query(mysql, "alter table t1 add column d int");
|
rc= mysql_query(mysql, "alter table t1 add column d int");
|
||||||
@@ -657,7 +657,7 @@ static int test_wl4166_4(MYSQL *mysql)
|
|||||||
stmt_text= "select c1, c2 from t1";
|
stmt_text= "select c1, c2 from t1";
|
||||||
|
|
||||||
/* c1 and c2 are binary so no conversion will be done on select */
|
/* c1 and c2 are binary so no conversion will be done on select */
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
|
@@ -39,7 +39,7 @@ static int perf1(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
|
|
||||||
diag("prepare");
|
diag("prepare");
|
||||||
rc= mysql_stmt_prepare(stmt, stmtstr, strlen(stmtstr));
|
rc= mysql_stmt_prepare(stmt, stmtstr, (unsigned long)strlen(stmtstr));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
diag("execute");
|
diag("execute");
|
||||||
|
@@ -148,7 +148,7 @@ static int test_prepare_insert_update(MYSQL *mysql)
|
|||||||
strcpy(query, *cur_query);
|
strcpy(query, *cur_query);
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 0, "Paramcount is not 0");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 0, "Paramcount is not 0");
|
||||||
@@ -266,7 +266,7 @@ static int test_bind_date_conv(MYSQL *mysql, uint row_count)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "SELECT * FROM test_date", strlen("SELECT * FROM test_date"));
|
rc= mysql_stmt_prepare(stmt, "SELECT * FROM test_date", (unsigned long)strlen("SELECT * FROM test_date"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_bind_result(stmt, my_bind);
|
rc= mysql_stmt_bind_result(stmt, my_bind);
|
||||||
@@ -322,7 +322,7 @@ static int test_prepare_simple(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO test_prepare_simple VALUES(?, ?)");
|
strcpy(query, "INSERT INTO test_prepare_simple VALUES(?, ?)");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount is not 2");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount is not 2");
|
||||||
@@ -333,7 +333,7 @@ static int test_prepare_simple(MYSQL *mysql)
|
|||||||
"WHERE id=? AND CONVERT(name USING utf8)= ?");
|
"WHERE id=? AND CONVERT(name USING utf8)= ?");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 3, "Paramcount is not 3");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 3, "Paramcount is not 3");
|
||||||
@@ -343,7 +343,7 @@ static int test_prepare_simple(MYSQL *mysql)
|
|||||||
strcpy(query, "DELETE FROM test_prepare_simple WHERE id=10");
|
strcpy(query, "DELETE FROM test_prepare_simple WHERE id=10");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 0, "Paramcount is not 0");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 0, "Paramcount is not 0");
|
||||||
@@ -356,7 +356,7 @@ static int test_prepare_simple(MYSQL *mysql)
|
|||||||
strcpy(query, "DELETE FROM test_prepare_simple WHERE id=?");
|
strcpy(query, "DELETE FROM test_prepare_simple WHERE id=?");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "Paramcount != 1");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "Paramcount != 1");
|
||||||
@@ -368,7 +368,7 @@ static int test_prepare_simple(MYSQL *mysql)
|
|||||||
"AND CONVERT(name USING utf8)= ?");
|
"AND CONVERT(name USING utf8)= ?");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2");
|
||||||
@@ -404,7 +404,7 @@ static int test_prepare_field_result(MYSQL *mysql)
|
|||||||
" test_prepare_field_result as t1 WHERE int_c=?");
|
" test_prepare_field_result as t1 WHERE int_c=?");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "Paramcount != 1");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "Paramcount != 1");
|
||||||
@@ -463,12 +463,12 @@ static int test_prepare_syntax(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO test_prepare_syntax VALUES(?");
|
strcpy(query, "INSERT INTO test_prepare_syntax VALUES(?");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
FAIL_IF(!rc, "error expected");
|
FAIL_IF(!rc, "error expected");
|
||||||
|
|
||||||
strcpy(query, "SELECT id, name FROM test_prepare_syntax WHERE id=? AND WHERE");
|
strcpy(query, "SELECT id, name FROM test_prepare_syntax WHERE id=? AND WHERE");
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
FAIL_IF(!rc, "error expected");
|
FAIL_IF(!rc, "error expected");
|
||||||
|
|
||||||
/* now fetch the results ..*/
|
/* now fetch the results ..*/
|
||||||
@@ -514,7 +514,7 @@ static int test_prepare(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO my_prepare VALUES(?, ?, ?, ?, ?, ?, ?)");
|
strcpy(query, "INSERT INTO my_prepare VALUES(?, ?, ?, ?, ?, ?, ?)");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 7, "Paramcount != 7");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 7, "Paramcount != 7");
|
||||||
@@ -658,7 +658,7 @@ static int test_prepare_multi_statements(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
FAIL_IF(!rc, "Error expected");
|
FAIL_IF(!rc, "Error expected");
|
||||||
|
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
@@ -724,7 +724,7 @@ static int test_prepare_ext(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO test_prepare_ext(c1, c2, c3, c4, c5, c6) VALUES(?, ?, ?, ?, ?, ?)");
|
strcpy(query, "INSERT INTO test_prepare_ext(c1, c2, c3, c4, c5, c6) VALUES(?, ?, ?, ?, ?, ?)");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 6, "Paramcount != 6");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 6, "Paramcount != 6");
|
||||||
@@ -773,7 +773,7 @@ static int test_prepare_ext(MYSQL *mysql)
|
|||||||
strcpy(query, "SELECT c1, c2, c3, c4, c5, c6 FROM test_prepare_ext");
|
strcpy(query, "SELECT c1, c2, c3, c4, c5, c6 FROM test_prepare_ext");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
/* get the result */
|
/* get the result */
|
||||||
@@ -813,7 +813,7 @@ static int test_prepare_alter(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO test_prep_alter VALUES(?, 'monty')");
|
strcpy(query, "INSERT INTO test_prep_alter VALUES(?, 'monty')");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "Paramcount != 1");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "Paramcount != 1");
|
||||||
@@ -874,7 +874,7 @@ static int test_prepare_resultset(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
strcpy(query, "SELECT * FROM test_prepare_resultset");
|
strcpy(query, "SELECT * FROM test_prepare_resultset");
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt), "Paramcount != 0");
|
FAIL_IF(mysql_stmt_param_count(stmt), "Paramcount != 0");
|
||||||
@@ -907,7 +907,7 @@ static int test_open_direct(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO test_open_direct values(10, 'mysql')");
|
strcpy(query, "INSERT INTO test_open_direct values(10, 'mysql')");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_query(mysql, "SELECT * FROM test_open_direct");
|
rc= mysql_query(mysql, "SELECT * FROM test_open_direct");
|
||||||
@@ -953,7 +953,7 @@ static int test_open_direct(MYSQL *mysql)
|
|||||||
strcpy(query, "SELECT * FROM test_open_direct");
|
strcpy(query, "SELECT * FROM test_open_direct");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -974,7 +974,7 @@ static int test_open_direct(MYSQL *mysql)
|
|||||||
/* run a direct query with store result */
|
/* run a direct query with store result */
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -1015,7 +1015,7 @@ static int test_select_show(MYSQL *mysql)
|
|||||||
strcpy(query, "show columns from test_show");
|
strcpy(query, "show columns from test_show");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 0, "Paramcount != 0");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 0, "Paramcount != 0");
|
||||||
@@ -1033,12 +1033,12 @@ static int test_select_show(MYSQL *mysql)
|
|||||||
strcpy(query, "show tables from mysql like ?");
|
strcpy(query, "show tables from mysql like ?");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
FAIL_IF(!rc, "Error expected");
|
FAIL_IF(!rc, "Error expected");
|
||||||
|
|
||||||
strcpy(query, "show tables like \'test_show\'");
|
strcpy(query, "show tables like \'test_show\'");
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -1053,7 +1053,7 @@ static int test_select_show(MYSQL *mysql)
|
|||||||
strcpy(query, "describe test_show");
|
strcpy(query, "describe test_show");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -1068,7 +1068,7 @@ static int test_select_show(MYSQL *mysql)
|
|||||||
strcpy(query, "show keys from test_show");
|
strcpy(query, "show keys from test_show");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -1120,7 +1120,7 @@ static int test_simple_update(MYSQL *mysql)
|
|||||||
strcpy(query, "UPDATE test_update SET col2= ? WHERE col1= ?");
|
strcpy(query, "UPDATE test_update SET col2= ? WHERE col1= ?");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2");
|
||||||
@@ -1196,7 +1196,7 @@ static int test_long_data(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO test_long_data(col1, col2) VALUES(?)");
|
strcpy(query, "INSERT INTO test_long_data(col1, col2) VALUES(?)");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
FAIL_IF(!rc, "Error expected");
|
FAIL_IF(!rc, "Error expected");
|
||||||
rc= mysql_stmt_close(stmt);
|
rc= mysql_stmt_close(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -1204,7 +1204,7 @@ static int test_long_data(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO test_long_data(col1, col2, col3) VALUES(?, ?, ?)");
|
strcpy(query, "INSERT INTO test_long_data(col1, col2, col3) VALUES(?, ?, ?)");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt)
|
check_stmt_rc(rc, stmt)
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 3, "Paramcount != 3");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 3, "Paramcount != 3");
|
||||||
@@ -1224,10 +1224,10 @@ static int test_long_data(MYSQL *mysql)
|
|||||||
data= (char *)"Michael";
|
data= (char *)"Michael";
|
||||||
|
|
||||||
/* supply data in pieces */
|
/* supply data in pieces */
|
||||||
rc= mysql_stmt_send_long_data(stmt, 1, data, strlen(data));
|
rc= mysql_stmt_send_long_data(stmt, 1, data, (unsigned long)strlen(data));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
data= (char *)" 'Monty' Widenius";
|
data= (char *)" 'Monty' Widenius";
|
||||||
rc= mysql_stmt_send_long_data(stmt, 1, data, strlen(data));
|
rc= mysql_stmt_send_long_data(stmt, 1, data, (unsigned long)strlen(data));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_send_long_data(stmt, 2, "Venu (venu@mysql.com)", 4);
|
rc= mysql_stmt_send_long_data(stmt, 2, "Venu (venu@mysql.com)", 4);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -1297,7 +1297,7 @@ static int test_long_data_str(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO test_long_data_str VALUES(?, ?)");
|
strcpy(query, "INSERT INTO test_long_data_str VALUES(?, ?)");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt)
|
check_stmt_rc(rc, stmt)
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2");
|
||||||
@@ -1396,7 +1396,7 @@ static int test_long_data_str1(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO test_long_data_str VALUES(?, ?)");
|
strcpy(query, "INSERT INTO test_long_data_str VALUES(?, ?)");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt)
|
check_stmt_rc(rc, stmt)
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2");
|
||||||
@@ -1466,7 +1466,7 @@ static int test_long_data_str1(MYSQL *mysql)
|
|||||||
strcpy(query, "SELECT * from test_long_data_str");
|
strcpy(query, "SELECT * from test_long_data_str");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt)
|
check_stmt_rc(rc, stmt)
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 0, "Paramcount != 0");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 0, "Paramcount != 0");
|
||||||
@@ -1561,7 +1561,7 @@ static int test_long_data_bin(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO test_long_data_bin VALUES(?, ?)");
|
strcpy(query, "INSERT INTO test_long_data_bin VALUES(?, ?)");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt)
|
check_stmt_rc(rc, stmt)
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2");
|
||||||
@@ -1654,7 +1654,7 @@ static int test_simple_delete(MYSQL *mysql)
|
|||||||
"CONVERT(col2 USING utf8)= ? AND col3= 100");
|
"CONVERT(col2 USING utf8)= ? AND col3= 100");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt)
|
check_stmt_rc(rc, stmt)
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2");
|
||||||
@@ -1730,7 +1730,7 @@ static int test_update(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO test_update(col2, col3) VALUES(?, ?)");
|
strcpy(query, "INSERT INTO test_update(col2, col3) VALUES(?, ?)");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2");
|
||||||
@@ -1760,7 +1760,7 @@ static int test_update(MYSQL *mysql)
|
|||||||
strcpy(query, "UPDATE test_update SET col2= ? WHERE col3= ?");
|
strcpy(query, "UPDATE test_update SET col2= ? WHERE col3= ?");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2");
|
||||||
@@ -1830,7 +1830,7 @@ static int test_prepare_noparam(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO my_prepare VALUES(10, 'venu')");
|
strcpy(query, "INSERT INTO my_prepare VALUES(10, 'venu')");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 0, "Paramcount != 0");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 0, "Paramcount != 0");
|
||||||
@@ -1911,7 +1911,7 @@ static int test_bind_result(MYSQL *mysql)
|
|||||||
strcpy(query, "SELECT * FROM test_bind_result");
|
strcpy(query, "SELECT * FROM test_bind_result");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_bind_result(stmt, my_bind);
|
rc= mysql_stmt_bind_result(stmt, my_bind);
|
||||||
@@ -2025,7 +2025,7 @@ static int test_bind_result_ext(MYSQL *mysql)
|
|||||||
strcpy(query, "select * from test_bind_result");
|
strcpy(query, "select * from test_bind_result");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_bind_result(stmt, my_bind);
|
rc= mysql_stmt_bind_result(stmt, my_bind);
|
||||||
@@ -2144,7 +2144,7 @@ static int test_bind_result_ext1(MYSQL *mysql)
|
|||||||
strcpy(query, "select * from test_bind_result");
|
strcpy(query, "select * from test_bind_result");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_bind_result(stmt, my_bind);
|
rc= mysql_stmt_bind_result(stmt, my_bind);
|
||||||
@@ -2202,7 +2202,7 @@ static int test_bind_negative(MYSQL *mysql)
|
|||||||
query= (char*)"INSERT INTO t1 VALUES (?)";
|
query= (char*)"INSERT INTO t1 VALUES (?)";
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
/* bind parameters */
|
/* bind parameters */
|
||||||
@@ -2250,7 +2250,7 @@ static int test_buffers(MYSQL *mysql)
|
|||||||
strcpy(query, "select str from test_buffer");
|
strcpy(query, "select str from test_buffer");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -2353,7 +2353,7 @@ static int test_xjoin(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
for (i= 0; i < 3; i++)
|
for (i= 0; i < 3; i++)
|
||||||
@@ -2388,7 +2388,7 @@ static int test_union_param(MYSQL *mysql)
|
|||||||
query= (char*)"select ? as my_col union distinct select ?";
|
query= (char*)"select ? as my_col union distinct select ?";
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -2466,7 +2466,7 @@ static int test_union(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -2502,7 +2502,7 @@ static int test_union2(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
for (i= 0; i < 3; i++)
|
for (i= 0; i < 3; i++)
|
||||||
@@ -2541,14 +2541,14 @@ static int test_pure_coverage(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "insert into test_pure(c67788) values(10)", strlen("insert into test_pure(c67788) values(10)"));
|
rc= mysql_stmt_prepare(stmt, "insert into test_pure(c67788) values(10)", (unsigned long)strlen("insert into test_pure(c67788) values(10)"));
|
||||||
FAIL_IF(!rc, "Error expected");
|
FAIL_IF(!rc, "Error expected");
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
|
|
||||||
/* Query without params and result should allow to bind 0 arrays */
|
/* Query without params and result should allow to bind 0 arrays */
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "insert into test_pure(c2) values(10)", strlen("insert into test_pure(c2) values(10)"));
|
rc= mysql_stmt_prepare(stmt, "insert into test_pure(c2) values(10)", (unsigned long)strlen("insert into test_pure(c2) values(10)"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_bind_param(stmt, (MYSQL_BIND*)0);
|
rc= mysql_stmt_bind_param(stmt, (MYSQL_BIND*)0);
|
||||||
@@ -2562,7 +2562,7 @@ static int test_pure_coverage(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "insert into test_pure(c2) values(?)", strlen("insert into test_pure(c2) values(?)"));
|
rc= mysql_stmt_prepare(stmt, "insert into test_pure(c2) values(?)", (unsigned long)strlen("insert into test_pure(c2) values(?)"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -2587,7 +2587,7 @@ static int test_pure_coverage(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "select * from test_pure", strlen("select * from test_pure"));
|
rc= mysql_stmt_prepare(stmt, "select * from test_pure", (unsigned long)strlen("select * from test_pure"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -2619,13 +2619,13 @@ static int test_insert_select(MYSQL *mysql)
|
|||||||
query= (char*)"insert into t1 select a from t2";
|
query= (char*)"insert into t1 select a from t2";
|
||||||
stmt_insert= mysql_stmt_init(mysql);
|
stmt_insert= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt_insert, mysql_error(mysql));
|
FAIL_IF(!stmt_insert, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt_insert, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt_insert, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt_insert);
|
check_stmt_rc(rc, stmt_insert);
|
||||||
|
|
||||||
query= (char*)"select * from t1";
|
query= (char*)"select * from t1";
|
||||||
stmt_select= mysql_stmt_init(mysql);
|
stmt_select= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt_select, mysql_error(mysql));
|
FAIL_IF(!stmt_select, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt_select, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt_select, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt_select);
|
check_stmt_rc(rc, stmt_select);
|
||||||
|
|
||||||
for(i= 0; i < 3; i++)
|
for(i= 0; i < 3; i++)
|
||||||
@@ -2675,7 +2675,7 @@ static int test_insert(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "INSERT INTO test_prep_insert VALUES(?, ?)",
|
rc= mysql_stmt_prepare(stmt, "INSERT INTO test_prep_insert VALUES(?, ?)",
|
||||||
strlen("INSERT INTO test_prep_insert VALUES(?, ?)"));
|
(unsigned long)strlen("INSERT INTO test_prep_insert VALUES(?, ?)"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Param_count != 2");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Param_count != 2");
|
||||||
@@ -2769,7 +2769,7 @@ static int test_join(MYSQL *mysql)
|
|||||||
{
|
{
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query[j], strlen(query[j]));
|
rc= mysql_stmt_prepare(stmt, query[j], (unsigned long)strlen(query[j]));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
for (i= 0; i < 3; i++)
|
for (i= 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
@@ -2808,7 +2808,7 @@ static int test_left_join_view(MYSQL *mysql)
|
|||||||
rc= mysql_query(mysql,"create view v1 (x) as select a from t1 where a > 1");
|
rc= mysql_query(mysql,"create view v1 (x) as select a from t1 where a > 1");
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
for (i= 0; i < 3; i++)
|
for (i= 0; i < 3; i++)
|
||||||
@@ -2863,7 +2863,7 @@ static int test_manual_sample(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO test_table(col1, col2, col3) values(?, ?, ?)");
|
strcpy(query, "INSERT INTO test_table(col1, col2, col3) values(?, ?, ?)");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
/* Get the parameter count from the statement */
|
/* Get the parameter count from the statement */
|
||||||
@@ -2952,19 +2952,19 @@ static int test_create_drop(MYSQL *mysql)
|
|||||||
query= (char*)"create table t1 (a int)";
|
query= (char*)"create table t1 (a int)";
|
||||||
stmt_create= mysql_stmt_init(mysql);
|
stmt_create= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt_create, mysql_error(mysql));
|
FAIL_IF(!stmt_create, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt_create, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt_create, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt_create);
|
check_stmt_rc(rc, stmt_create);
|
||||||
|
|
||||||
query= (char*)"drop table t1";
|
query= (char*)"drop table t1";
|
||||||
stmt_drop= mysql_stmt_init(mysql);
|
stmt_drop= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt_drop, mysql_error(mysql));
|
FAIL_IF(!stmt_drop, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt_drop, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt_drop, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt_drop);
|
check_stmt_rc(rc, stmt_drop);
|
||||||
|
|
||||||
query= (char*)"select a in (select a from t2) from t1";
|
query= (char*)"select a in (select a from t2) from t1";
|
||||||
stmt_select= mysql_stmt_init(mysql);
|
stmt_select= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt_select, mysql_error(mysql));
|
FAIL_IF(!stmt_select, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt_select, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt_select, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt_select);
|
check_stmt_rc(rc, stmt_select);
|
||||||
|
|
||||||
rc= mysql_query(mysql, "DROP TABLE t1");
|
rc= mysql_query(mysql, "DROP TABLE t1");
|
||||||
@@ -2973,7 +2973,7 @@ static int test_create_drop(MYSQL *mysql)
|
|||||||
query= (char*)"create table t1 select a from t2";
|
query= (char*)"create table t1 select a from t2";
|
||||||
stmt_create_select= mysql_stmt_init(mysql);
|
stmt_create_select= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt_create_select, mysql_error(mysql));
|
FAIL_IF(!stmt_create_select, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt_create_select, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt_create_select, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt_create_select);
|
check_stmt_rc(rc, stmt_create_select);
|
||||||
|
|
||||||
for (i= 0; i < 3; i++)
|
for (i= 0; i < 3; i++)
|
||||||
@@ -3139,18 +3139,18 @@ static int test_datetime_ranges(MYSQL *mysql)
|
|||||||
|
|
||||||
|
|
||||||
stmt_text= "drop table if exists t1";
|
stmt_text= "drop table if exists t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "create table t1 (year datetime, month datetime, day datetime, "
|
stmt_text= "create table t1 (year datetime, month datetime, day datetime, "
|
||||||
"hour datetime, min datetime, sec datetime)";
|
"hour datetime, min datetime, sec datetime)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
stmt_text= "INSERT INTO t1 VALUES (?, ?, ?, ?, ?, ?)";
|
stmt_text= "INSERT INTO t1 VALUES (?, ?, ?, ?, ?, ?)";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 6, "param_count != 6");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 6, "param_count != 6");
|
||||||
|
|
||||||
@@ -3192,13 +3192,13 @@ static int test_datetime_ranges(MYSQL *mysql)
|
|||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
|
|
||||||
stmt_text= "delete from t1";
|
stmt_text= "delete from t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "INSERT INTO t1 (year, month, day) VALUES (?, ?, ?)";
|
stmt_text= "INSERT INTO t1 (year, month, day) VALUES (?, ?, ?)";
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -3224,17 +3224,17 @@ static int test_datetime_ranges(MYSQL *mysql)
|
|||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
|
|
||||||
stmt_text= "drop table t1";
|
stmt_text= "drop table t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "create table t1 (day_ovfl time, day time, hour time, min time, sec time)";
|
stmt_text= "create table t1 (day_ovfl time, day time, hour time, min time, sec time)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
stmt_text= "INSERT INTO t1 VALUES (?,?,?,?,?)";
|
stmt_text= "INSERT INTO t1 VALUES (?,?,?,?,?)";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 5, "param_count != 5");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 5, "param_count != 5");
|
||||||
|
|
||||||
@@ -3271,13 +3271,13 @@ static int test_datetime_ranges(MYSQL *mysql)
|
|||||||
|
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
stmt_text= "drop table t1";
|
stmt_text= "drop table t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
return OK;
|
return OK;
|
||||||
error:
|
error:
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
stmt_text= "drop table t1";
|
stmt_text= "drop table t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@@ -3306,7 +3306,7 @@ ENGINE=InnoDB DEFAULT CHARSET=utf8");
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(my_bind, '\0', sizeof(my_bind));
|
memset(my_bind, '\0', sizeof(my_bind));
|
||||||
@@ -3358,7 +3358,7 @@ static int test_distinct(MYSQL *mysql)
|
|||||||
{
|
{
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -3390,13 +3390,13 @@ static int test_do_set(MYSQL *mysql)
|
|||||||
query= (char*)"do @var:=(1 in (select * from t1))";
|
query= (char*)"do @var:=(1 in (select * from t1))";
|
||||||
stmt_do= mysql_stmt_init(mysql);
|
stmt_do= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt_do, mysql_error(mysql));
|
FAIL_IF(!stmt_do, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt_do, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt_do, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt_do);
|
check_stmt_rc(rc, stmt_do);
|
||||||
|
|
||||||
query= (char*)"set @var=(1 in (select * from t1))";
|
query= (char*)"set @var=(1 in (select * from t1))";
|
||||||
stmt_set= mysql_stmt_init(mysql);
|
stmt_set= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt_set, mysql_error(mysql));
|
FAIL_IF(!stmt_set, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt_set, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt_set, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt_set);
|
check_stmt_rc(rc, stmt_set);
|
||||||
|
|
||||||
for (i= 0; i < 3; i++)
|
for (i= 0; i < 3; i++)
|
||||||
@@ -3442,7 +3442,7 @@ static int test_double_compare(MYSQL *mysql)
|
|||||||
"WHERE col1 = ? AND col2 = ? AND COL3 = ?");
|
"WHERE col1 = ? AND col2 = ? AND COL3 = ?");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 3, "param_count != 3");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 3, "param_count != 3");
|
||||||
@@ -3536,25 +3536,25 @@ static int test_multi(MYSQL *mysql)
|
|||||||
query= (char*)"delete t1, t2 from t1, t2 where t1.a=t2.a and t1.b=10";
|
query= (char*)"delete t1, t2 from t1, t2 where t1.a=t2.a and t1.b=10";
|
||||||
stmt_delete= mysql_stmt_init(mysql);
|
stmt_delete= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt_delete, mysql_error(mysql));
|
FAIL_IF(!stmt_delete, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt_delete, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt_delete, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt_delete);
|
check_stmt_rc(rc, stmt_delete);
|
||||||
|
|
||||||
query= (char*)"update t1, t2 set t1.b=10, t2.b=10 where t1.a=t2.a and t1.b=?";
|
query= (char*)"update t1, t2 set t1.b=10, t2.b=10 where t1.a=t2.a and t1.b=?";
|
||||||
stmt_update= mysql_stmt_init(mysql);
|
stmt_update= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt_update, mysql_error(mysql));
|
FAIL_IF(!stmt_update, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt_update, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt_update, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt_update);
|
check_stmt_rc(rc, stmt_update);
|
||||||
|
|
||||||
query= (char*)"select * from t1";
|
query= (char*)"select * from t1";
|
||||||
stmt_select1= mysql_stmt_init(mysql);
|
stmt_select1= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt_select1, mysql_error(mysql));
|
FAIL_IF(!stmt_select1, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt_select1, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt_select1, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt_select1);
|
check_stmt_rc(rc, stmt_select1);
|
||||||
|
|
||||||
query= (char*)"select * from t2";
|
query= (char*)"select * from t2";
|
||||||
stmt_select2= mysql_stmt_init(mysql);
|
stmt_select2= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt_select2, mysql_error(mysql));
|
FAIL_IF(!stmt_select2, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt_select2, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt_select2, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt_select2);
|
check_stmt_rc(rc, stmt_select2);
|
||||||
|
|
||||||
for(i= 0; i < 3; i++)
|
for(i= 0; i < 3; i++)
|
||||||
@@ -3621,13 +3621,13 @@ static int test_multi_stmt(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
query= "SELECT * FROM test_multi_table WHERE id=?";
|
query= "SELECT * FROM test_multi_table WHERE id=?";
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
stmt2= mysql_stmt_init(mysql);
|
stmt2= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt2, mysql_error(mysql));
|
FAIL_IF(!stmt2, mysql_error(mysql));
|
||||||
query= "UPDATE test_multi_table SET name='updated' WHERE id=10";
|
query= "UPDATE test_multi_table SET name='updated' WHERE id=10";
|
||||||
rc= mysql_stmt_prepare(stmt2, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt2, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt2);
|
check_stmt_rc(rc, stmt2);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "param_count != 1");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "param_count != 1");
|
||||||
@@ -3671,7 +3671,7 @@ static int test_multi_stmt(MYSQL *mysql)
|
|||||||
stmt1= mysql_stmt_init(mysql);
|
stmt1= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt1, mysql_error(mysql));
|
FAIL_IF(!stmt1, mysql_error(mysql));
|
||||||
query= "DELETE FROM test_multi_table WHERE id=? AND CONVERT(name USING utf8)=?";
|
query= "DELETE FROM test_multi_table WHERE id=? AND CONVERT(name USING utf8)=?";
|
||||||
rc= mysql_stmt_prepare(stmt1, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt1, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt1);
|
check_stmt_rc(rc, stmt1);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt1) != 2, "param_count != 2");
|
FAIL_IF(mysql_stmt_param_count(stmt1) != 2, "param_count != 2");
|
||||||
@@ -3748,7 +3748,7 @@ static int test_nstmts(MYSQL *mysql)
|
|||||||
strcpy(query, "insert into test_nstmts values(?)");
|
strcpy(query, "insert into test_nstmts values(?)");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_bind_param(stmt, my_bind);
|
rc= mysql_stmt_bind_param(stmt, my_bind);
|
||||||
@@ -3762,7 +3762,7 @@ static int test_nstmts(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, " select count(*) from test_nstmts", strlen(" select count(*) from test_nstmts"));
|
rc= mysql_stmt_prepare(stmt, " select count(*) from test_nstmts", (unsigned long)strlen(" select count(*) from test_nstmts"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -3808,14 +3808,14 @@ static int test_null(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO test_null(col3, col2) VALUES(?, ?)");
|
strcpy(query, "INSERT INTO test_null(col3, col2) VALUES(?, ?)");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
FAIL_IF(!rc, "Error expected");
|
FAIL_IF(!rc, "Error expected");
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
|
|
||||||
strcpy(query, "INSERT INTO test_null(col1, col2) VALUES(?, ?)");
|
strcpy(query, "INSERT INTO test_null(col1, col2) VALUES(?, ?)");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "param_count != 2");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "param_count != 2");
|
||||||
@@ -3871,7 +3871,7 @@ static int test_null(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "SELECT * FROM test_null", strlen("SELECT * FROM test_null"));
|
rc= mysql_stmt_prepare(stmt, "SELECT * FROM test_null", (unsigned long)strlen("SELECT * FROM test_null"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -3913,7 +3913,7 @@ static int test_order_param(MYSQL *mysql)
|
|||||||
query= "select sum(a) + 200, 1 from t1 "
|
query= "select sum(a) + 200, 1 from t1 "
|
||||||
" union distinct "
|
" union distinct "
|
||||||
"select sum(a) + 200, 1 from t1 group by b ";
|
"select sum(a) + 200, 1 from t1 group by b ";
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
|
|
||||||
@@ -3922,7 +3922,7 @@ static int test_order_param(MYSQL *mysql)
|
|||||||
query= "select sum(a) + 200, ? from t1 group by b "
|
query= "select sum(a) + 200, ? from t1 group by b "
|
||||||
" union distinct "
|
" union distinct "
|
||||||
"select sum(a) + 200, 1 from t1 group by b ";
|
"select sum(a) + 200, 1 from t1 group by b ";
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
|
|
||||||
@@ -3931,7 +3931,7 @@ static int test_order_param(MYSQL *mysql)
|
|||||||
query= "select sum(a) + 200, ? from t1 "
|
query= "select sum(a) + 200, ? from t1 "
|
||||||
" union distinct "
|
" union distinct "
|
||||||
"select sum(a) + 200, 1 from t1 group by b ";
|
"select sum(a) + 200, 1 from t1 group by b ";
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
|
|
||||||
@@ -3951,7 +3951,7 @@ static int test_rename(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_query(mysql, "create table t1 (a int)");
|
rc= mysql_query(mysql, "create table t1 (a int)");
|
||||||
@@ -3993,15 +3993,15 @@ static int test_rewind(MYSQL *mysql)
|
|||||||
|
|
||||||
|
|
||||||
stmt_text= "CREATE TABLE t1 (a int)";
|
stmt_text= "CREATE TABLE t1 (a int)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
stmt_text= "INSERT INTO t1 VALUES(2),(3),(4)";
|
stmt_text= "INSERT INTO t1 VALUES(2),(3),(4)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
stmt_text= "SELECT * FROM t1";
|
stmt_text= "SELECT * FROM t1";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(&my_bind, '\0', sizeof(MYSQL_BIND));
|
memset(&my_bind, '\0', sizeof(MYSQL_BIND));
|
||||||
@@ -4033,7 +4033,7 @@ static int test_rewind(MYSQL *mysql)
|
|||||||
FAIL_UNLESS(rc == MYSQL_NO_DATA, "rc != MYSQL_NO_DATA");
|
FAIL_UNLESS(rc == MYSQL_NO_DATA, "rc != MYSQL_NO_DATA");
|
||||||
|
|
||||||
stmt_text= "DROP TABLE t1";
|
stmt_text= "DROP TABLE t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
rc= mysql_stmt_free_result(stmt);
|
rc= mysql_stmt_free_result(stmt);
|
||||||
rc= mysql_stmt_close(stmt);
|
rc= mysql_stmt_close(stmt);
|
||||||
@@ -4077,7 +4077,7 @@ static int test_select(MYSQL *mysql)
|
|||||||
"AND CONVERT(name USING utf8) =?");
|
"AND CONVERT(name USING utf8) =?");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "param_count != 2");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "param_count != 2");
|
||||||
@@ -4139,7 +4139,7 @@ static int test_select_prepare(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "SELECT * FROM test_select", strlen("SELECT * FROM test_select"));
|
rc= mysql_stmt_prepare(stmt, "SELECT * FROM test_select", (unsigned long)strlen("SELECT * FROM test_select"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -4168,7 +4168,7 @@ static int test_select_prepare(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "SELECT * FROM test_select", strlen("SELECT * FROM test_select"));
|
rc= mysql_stmt_prepare(stmt, "SELECT * FROM test_select", (unsigned long)strlen("SELECT * FROM test_select"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -4193,7 +4193,7 @@ static int test_select_show_table(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "SHOW TABLES FROM mysql", strlen("SHOW TABLES FROM mysql"));
|
rc= mysql_stmt_prepare(stmt, "SHOW TABLES FROM mysql", (unsigned long)strlen("SHOW TABLES FROM mysql"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt), "param_count != 0");
|
FAIL_IF(mysql_stmt_param_count(stmt), "param_count != 0");
|
||||||
@@ -4219,7 +4219,7 @@ static int test_select_version(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "SELECT @@version", strlen("SELECT @@version"));
|
rc= mysql_stmt_prepare(stmt, "SELECT @@version", (unsigned long)strlen("SELECT @@version"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt), "param_count != 0");
|
FAIL_IF(mysql_stmt_param_count(stmt), "param_count != 0");
|
||||||
@@ -4264,7 +4264,7 @@ static int test_selecttmp(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
for (i= 0; i < 3; i++)
|
for (i= 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
@@ -4318,7 +4318,7 @@ static int test_set_option(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "SELECT * FROM test_limit", strlen("SELECT * FROM test_limit"));
|
rc= mysql_stmt_prepare(stmt, "SELECT * FROM test_limit", (unsigned long)strlen("SELECT * FROM test_limit"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -4337,7 +4337,7 @@ static int test_set_option(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "SELECT * FROM test_limit", strlen("SELECT * FROM test_limit"));
|
rc= mysql_stmt_prepare(stmt, "SELECT * FROM test_limit", (unsigned long)strlen("SELECT * FROM test_limit"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -4370,7 +4370,7 @@ static int test_set_variable(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt1= mysql_stmt_init(mysql);
|
stmt1= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt1, mysql_error(mysql));
|
FAIL_IF(!stmt1, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt1, "show variables like 'max_error_count'", strlen("show variables like 'max_error_count'"));
|
rc= mysql_stmt_prepare(stmt1, "show variables like 'max_error_count'", (unsigned long)strlen("show variables like 'max_error_count'"));
|
||||||
check_stmt_rc(rc, stmt1);
|
check_stmt_rc(rc, stmt1);
|
||||||
|
|
||||||
memset(get_bind, '\0', sizeof(get_bind));
|
memset(get_bind, '\0', sizeof(get_bind));
|
||||||
@@ -4401,7 +4401,7 @@ static int test_set_variable(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "set max_error_count=?", strlen("set max_error_count=?"));
|
rc= mysql_stmt_prepare(stmt, "set max_error_count=?", (unsigned long)strlen("set max_error_count=?"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(set_bind, '\0', sizeof(set_bind));
|
memset(set_bind, '\0', sizeof(set_bind));
|
||||||
@@ -4476,7 +4476,7 @@ static int test_sqlmode(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO test_piping VALUES(?||?)");
|
strcpy(query, "INSERT INTO test_piping VALUES(?||?)");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(my_bind, '\0', sizeof(my_bind));
|
memset(my_bind, '\0', sizeof(my_bind));
|
||||||
@@ -4506,7 +4506,7 @@ static int test_sqlmode(MYSQL *mysql)
|
|||||||
strcpy(query, "SELECT connection_id ()");
|
strcpy(query, "SELECT connection_id ()");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
|
|
||||||
@@ -4518,7 +4518,7 @@ static int test_sqlmode(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO test_piping VALUES(?||?)");
|
strcpy(query, "INSERT INTO test_piping VALUES(?||?)");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_bind_param(stmt, my_bind);
|
rc= mysql_stmt_bind_param(stmt, my_bind);
|
||||||
@@ -4542,7 +4542,7 @@ static int test_sqlmode(MYSQL *mysql)
|
|||||||
strcpy(query, "SELECT connection_id ()");
|
strcpy(query, "SELECT connection_id ()");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -4564,7 +4564,7 @@ static int test_sqlmode(MYSQL *mysql)
|
|||||||
strcpy(query, "SELECT connection_id ()");
|
strcpy(query, "SELECT connection_id ()");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -4608,7 +4608,7 @@ static int test_stmt_close(MYSQL *mysql)
|
|||||||
strcpy(query, "DO \"nothing\"");
|
strcpy(query, "DO \"nothing\"");
|
||||||
stmt1= mysql_stmt_init(mysql);
|
stmt1= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt1, mysql_error(mysql));
|
FAIL_IF(!stmt1, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt1, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt1, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt1);
|
check_stmt_rc(rc, stmt1);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt1), "param_count != 0");
|
FAIL_IF(mysql_stmt_param_count(stmt1), "param_count != 0");
|
||||||
@@ -4616,7 +4616,7 @@ static int test_stmt_close(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO test_stmt_close(id) VALUES(?)");
|
strcpy(query, "INSERT INTO test_stmt_close(id) VALUES(?)");
|
||||||
stmt_x= mysql_stmt_init(mysql);
|
stmt_x= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt_x, mysql_error(mysql));
|
FAIL_IF(!stmt_x, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt_x, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt_x, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt_x);
|
check_stmt_rc(rc, stmt_x);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt_x) != 1, "param_count != 1");
|
FAIL_IF(mysql_stmt_param_count(stmt_x) != 1, "param_count != 1");
|
||||||
@@ -4624,7 +4624,7 @@ static int test_stmt_close(MYSQL *mysql)
|
|||||||
strcpy(query, "UPDATE test_stmt_close SET id= ? WHERE id= ?");
|
strcpy(query, "UPDATE test_stmt_close SET id= ? WHERE id= ?");
|
||||||
stmt3= mysql_stmt_init(mysql);
|
stmt3= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt3, mysql_error(mysql));
|
FAIL_IF(!stmt3, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt3, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt3, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt3);
|
check_stmt_rc(rc, stmt3);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt3) != 2, "param_count != 2");
|
FAIL_IF(mysql_stmt_param_count(stmt3) != 2, "param_count != 2");
|
||||||
@@ -4632,7 +4632,7 @@ static int test_stmt_close(MYSQL *mysql)
|
|||||||
strcpy(query, "SELECT * FROM test_stmt_close WHERE id= ?");
|
strcpy(query, "SELECT * FROM test_stmt_close WHERE id= ?");
|
||||||
stmt2= mysql_stmt_init(mysql);
|
stmt2= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt2, mysql_error(mysql));
|
FAIL_IF(!stmt2, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt2, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt2, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt2);
|
check_stmt_rc(rc, stmt2);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt2) != 1, "param_count != 1");
|
FAIL_IF(mysql_stmt_param_count(stmt2) != 1, "param_count != 1");
|
||||||
@@ -4759,7 +4759,7 @@ static int test_long_data1(MYSQL *mysql)
|
|||||||
strcpy(query, "UPDATE tld SET col2=? WHERE col1=1");
|
strcpy(query, "UPDATE tld SET col2=? WHERE col1=1");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
memset(bind, 0, sizeof(MYSQL_BIND));
|
memset(bind, 0, sizeof(MYSQL_BIND));
|
||||||
bind[0].buffer_type= MYSQL_TYPE_STRING;
|
bind[0].buffer_type= MYSQL_TYPE_STRING;
|
||||||
@@ -4790,7 +4790,7 @@ int test_blob_9000(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
|
|
||||||
memset(bind, 0, sizeof(MYSQL_BIND));
|
memset(bind, 0, sizeof(MYSQL_BIND));
|
||||||
memset(buffer, 'C', 9200);
|
memset(buffer, 'C', 9200);
|
||||||
@@ -4817,7 +4817,7 @@ int test_fracseconds(MYSQL *mysql)
|
|||||||
MYSQL_BIND bind[2];
|
MYSQL_BIND bind[2];
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, str, strlen(str));
|
rc= mysql_stmt_prepare(stmt, str, (unsigned long)strlen(str));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -4893,7 +4893,7 @@ int test_notrunc(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -4941,7 +4941,7 @@ static int test_bit2tiny(MYSQL *mysql)
|
|||||||
mysql_query(mysql, "INSERT INTO justbit values (1)");
|
mysql_query(mysql, "INSERT INTO justbit values (1)");
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(bind, '\0', sizeof(bind));
|
memset(bind, '\0', sizeof(bind));
|
||||||
|
@@ -62,7 +62,7 @@ static int test_conc67(MYSQL *mysql)
|
|||||||
rc= mysql_stmt_attr_set(stmt, STMT_ATTR_PREFETCH_ROWS, &prefetch_rows);
|
rc= mysql_stmt_attr_set(stmt, STMT_ATTR_PREFETCH_ROWS, &prefetch_rows);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(&rbind, 0, sizeof(MYSQL_BIND));
|
memset(&rbind, 0, sizeof(MYSQL_BIND));
|
||||||
@@ -152,7 +152,7 @@ session_id char(9) NOT NULL, \
|
|||||||
"CONVERT(session_id USING utf8)= ?");
|
"CONVERT(session_id USING utf8)= ?");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "Paramcount != 1");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "Paramcount != 1");
|
||||||
@@ -244,7 +244,7 @@ static int test_bug1180(MYSQL *mysql)
|
|||||||
"session_id= \"abc\"");
|
"session_id= \"abc\"");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "Paramcount != 1");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "Paramcount != 1");
|
||||||
@@ -343,7 +343,7 @@ static int test_bug1644(MYSQL *mysql)
|
|||||||
strcpy(query, "INSERT INTO foo_dfr VALUES (?, ?, ?, ? )");
|
strcpy(query, "INSERT INTO foo_dfr VALUES (?, ?, ?, ? )");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 4, "Paramcount != 4");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 4, "Paramcount != 4");
|
||||||
@@ -444,7 +444,7 @@ static int test_bug11037(MYSQL *mysql)
|
|||||||
stmt_text= "select id FROM t1";
|
stmt_text= "select id FROM t1";
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
/* expected error */
|
/* expected error */
|
||||||
@@ -486,7 +486,7 @@ static int test_bug11183(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, bug_statement, strlen(bug_statement));
|
rc= mysql_stmt_prepare(stmt, bug_statement, (unsigned long)strlen(bug_statement));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_query(mysql, "drop table t1");
|
rc= mysql_query(mysql, "drop table t1");
|
||||||
@@ -572,7 +572,7 @@ static int test_bug1500(MYSQL *mysql)
|
|||||||
query= "SELECT i FROM test_bg1500 WHERE i IN (?, ?, ?)";
|
query= "SELECT i FROM test_bg1500 WHERE i IN (?, ?, ?)";
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 3, "paramcount != 3");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 3, "paramcount != 3");
|
||||||
@@ -614,7 +614,7 @@ static int test_bug1500(MYSQL *mysql)
|
|||||||
query= "SELECT s FROM test_bg1500 WHERE MATCH (s) AGAINST (?)";
|
query= "SELECT s FROM test_bg1500 WHERE MATCH (s) AGAINST (?)";
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "paramcount != 1");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "paramcount != 1");
|
||||||
@@ -643,7 +643,7 @@ static int test_bug1500(MYSQL *mysql)
|
|||||||
query= "SELECT s FROM test_bg1500 WHERE MATCH (s) AGAINST (CONCAT(?, 'digger'))";
|
query= "SELECT s FROM test_bg1500 WHERE MATCH (s) AGAINST (CONCAT(?, 'digger'))";
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "paramcount != 1");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "paramcount != 1");
|
||||||
@@ -683,7 +683,7 @@ static int test_bug15510(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -783,7 +783,7 @@ static int test_bug15613(MYSQL *mysql)
|
|||||||
|
|
||||||
/* II. Check SELECT metadata */
|
/* II. Check SELECT metadata */
|
||||||
stmt_text= ("select t, tt, mt, lt, vl, vb, vu from t1");
|
stmt_text= ("select t, tt, mt, lt, vl, vb, vu from t1");
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
metadata= mysql_stmt_result_metadata(stmt);
|
metadata= mysql_stmt_result_metadata(stmt);
|
||||||
field= mysql_fetch_fields(metadata);
|
field= mysql_fetch_fields(metadata);
|
||||||
FAIL_UNLESS(field[0].length == 65535, "length != 65535");
|
FAIL_UNLESS(field[0].length == 65535, "length != 65535");
|
||||||
@@ -844,7 +844,7 @@ static int test_bug1664(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Param count != 2");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Param count != 2");
|
||||||
@@ -868,7 +868,7 @@ static int test_bug1664(MYSQL *mysql)
|
|||||||
not break following execution.
|
not break following execution.
|
||||||
*/
|
*/
|
||||||
data= "";
|
data= "";
|
||||||
rc= mysql_stmt_send_long_data(stmt, 0, data, strlen(data));
|
rc= mysql_stmt_send_long_data(stmt, 0, data, (unsigned long)strlen(data));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -882,7 +882,7 @@ static int test_bug1664(MYSQL *mysql)
|
|||||||
|
|
||||||
/* This should pass OK */
|
/* This should pass OK */
|
||||||
data= (char *)"Data";
|
data= (char *)"Data";
|
||||||
rc= mysql_stmt_send_long_data(stmt, 0, data, strlen(data));
|
rc= mysql_stmt_send_long_data(stmt, 0, data, (unsigned long)strlen(data));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -923,7 +923,7 @@ static int test_bug1664(MYSQL *mysql)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
data= (char *)"SomeOtherData";
|
data= (char *)"SomeOtherData";
|
||||||
rc= mysql_stmt_send_long_data(stmt, 0, data, strlen(data));
|
rc= mysql_stmt_send_long_data(stmt, 0, data, (unsigned long)strlen(data));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -942,13 +942,13 @@ static int test_bug1664(MYSQL *mysql)
|
|||||||
|
|
||||||
/* Now let us test how mysql_stmt_reset works. */
|
/* Now let us test how mysql_stmt_reset works. */
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_bind_param(stmt, my_bind);
|
rc= mysql_stmt_bind_param(stmt, my_bind);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
data= (char *)"SomeData";
|
data= (char *)"SomeData";
|
||||||
rc= mysql_stmt_send_long_data(stmt, 0, data, strlen(data));
|
rc= mysql_stmt_send_long_data(stmt, 0, data, (unsigned long)strlen(data));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_reset(stmt);
|
rc= mysql_stmt_reset(stmt);
|
||||||
@@ -1004,7 +1004,7 @@ static int test_ushort_bug(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -1072,10 +1072,10 @@ static int test_bug1946(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_real_query(mysql, query, strlen(query));
|
rc= mysql_real_query(mysql, query, (unsigned long)strlen(query));
|
||||||
FAIL_IF(!rc, "Error expected");
|
FAIL_IF(!rc, "Error expected");
|
||||||
|
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
@@ -1112,7 +1112,7 @@ static int test_bug20152(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql)
|
check_mysql_rc(rc, mysql)
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_bind_param(stmt, my_bind);
|
rc= mysql_stmt_bind_param(stmt, my_bind);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -1150,7 +1150,7 @@ static int test_bug2247(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, insert, strlen(insert));
|
rc= mysql_stmt_prepare(stmt, insert, (unsigned long)strlen(insert));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
for (i= 0; i < NUM_ROWS; ++i)
|
for (i= 0; i < NUM_ROWS; ++i)
|
||||||
{
|
{
|
||||||
@@ -1184,7 +1184,7 @@ static int test_bug2247(MYSQL *mysql)
|
|||||||
/* check that mysql_stmt_store_result modifies mysql_stmt_affected_rows */
|
/* check that mysql_stmt_store_result modifies mysql_stmt_affected_rows */
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, SELECT, strlen(SELECT));
|
rc= mysql_stmt_prepare(stmt, SELECT, (unsigned long)strlen(SELECT));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -1223,7 +1223,7 @@ static int test_bug2248(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query1, strlen(query1));
|
rc= mysql_stmt_prepare(stmt, query1, (unsigned long)strlen(query1));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
/* This should not hang */
|
/* This should not hang */
|
||||||
@@ -1238,7 +1238,7 @@ static int test_bug2248(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query2, strlen(query2));
|
rc= mysql_stmt_prepare(stmt, query2, (unsigned long)strlen(query2));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -1304,7 +1304,7 @@ static int test_bug23383(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, insert_query, strlen(insert_query));
|
rc= mysql_stmt_prepare(stmt, insert_query, (unsigned long)strlen(insert_query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -1316,7 +1316,7 @@ static int test_bug23383(MYSQL *mysql)
|
|||||||
row_count= mysql_stmt_affected_rows(stmt);
|
row_count= mysql_stmt_affected_rows(stmt);
|
||||||
FAIL_UNLESS(row_count == (unsigned long long)-1, "rowcount != -1");
|
FAIL_UNLESS(row_count == (unsigned long long)-1, "rowcount != -1");
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, update_query, strlen(update_query));
|
rc= mysql_stmt_prepare(stmt, update_query, (unsigned long)strlen(update_query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -1349,7 +1349,7 @@ static int test_bug27592(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "INSERT INTO t1 VALUES (?)", strlen("INSERT INTO t1 VALUES (?)"));
|
rc= mysql_stmt_prepare(stmt, "INSERT INTO t1 VALUES (?)", (unsigned long)strlen("INSERT INTO t1 VALUES (?)"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(bind, '\0', sizeof(bind));
|
memset(bind, '\0', sizeof(bind));
|
||||||
@@ -1403,7 +1403,7 @@ static int test_bug28934(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "select * from t1 where id in(?,?,?,?,?)", strlen("select * from t1 where id in(?,?,?,?,?)"));
|
rc= mysql_stmt_prepare(stmt, "select * from t1 where id in(?,?,?,?,?)", (unsigned long)strlen("select * from t1 where id in(?,?,?,?,?)"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset (&bind, '\0', sizeof (bind));
|
memset (&bind, '\0', sizeof (bind));
|
||||||
@@ -1469,7 +1469,7 @@ static int test_bug3035(MYSQL *mysql)
|
|||||||
|
|
||||||
|
|
||||||
stmt_text= "DROP TABLE IF EXISTS t1";
|
stmt_text= "DROP TABLE IF EXISTS t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "CREATE TABLE t1 (i8 TINYINT, ui8 TINYINT UNSIGNED, "
|
stmt_text= "CREATE TABLE t1 (i8 TINYINT, ui8 TINYINT UNSIGNED, "
|
||||||
@@ -1477,7 +1477,7 @@ static int test_bug3035(MYSQL *mysql)
|
|||||||
"i32 INT, ui32 INT UNSIGNED, "
|
"i32 INT, ui32 INT UNSIGNED, "
|
||||||
"i64 BIGINT, ui64 BIGINT UNSIGNED, "
|
"i64 BIGINT, ui64 BIGINT UNSIGNED, "
|
||||||
"id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT)";
|
"id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
memset(bind_array, '\0', sizeof(bind_array));
|
memset(bind_array, '\0', sizeof(bind_array));
|
||||||
@@ -1517,7 +1517,7 @@ static int test_bug3035(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt_text= "INSERT INTO t1 (i8, ui8, i16, ui16, i32, ui32, i64, ui64) "
|
stmt_text= "INSERT INTO t1 (i8, ui8, i16, ui16, i32, ui32, i64, ui64) "
|
||||||
"VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
|
"VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
mysql_stmt_bind_param(stmt, bind_array);
|
mysql_stmt_bind_param(stmt, bind_array);
|
||||||
|
|
||||||
@@ -1547,7 +1547,7 @@ static int test_bug3035(MYSQL *mysql)
|
|||||||
"cast(ui64 as signed), ui64, cast(ui64 as signed)"
|
"cast(ui64 as signed), ui64, cast(ui64 as signed)"
|
||||||
"FROM t1 ORDER BY id ASC";
|
"FROM t1 ORDER BY id ASC";
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -1607,7 +1607,7 @@ static int test_bug3035(MYSQL *mysql)
|
|||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
|
|
||||||
stmt_text= "DROP TABLE t1";
|
stmt_text= "DROP TABLE t1";
|
||||||
mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1641,7 +1641,7 @@ static int test_ps_conj_select(MYSQL *mysql)
|
|||||||
"CONVERT(value1 USING utf8)= ?");
|
"CONVERT(value1 USING utf8)= ?");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "param_count != 2");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "param_count != 2");
|
||||||
@@ -1731,7 +1731,7 @@ static int test_ps_null_param(MYSQL *mysql)
|
|||||||
strcpy(query, *cur_query);
|
strcpy(query, *cur_query);
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
diag("statement: %s", query);
|
diag("statement: %s", query);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "param_count != 1");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 1, "param_count != 1");
|
||||||
@@ -1876,7 +1876,7 @@ static int test_ps_query_cache(MYSQL *mysql)
|
|||||||
"CONVERT(value1 USING utf8)= ?");
|
"CONVERT(value1 USING utf8)= ?");
|
||||||
stmt= mysql_stmt_init(lmysql);
|
stmt= mysql_stmt_init(lmysql);
|
||||||
FAIL_IF(!stmt, mysql_error(lmysql));
|
FAIL_IF(!stmt, mysql_error(lmysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "param_count != 2");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 2, "param_count != 2");
|
||||||
@@ -2021,7 +2021,7 @@ static int test_bug3117(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "SELECT LAST_INSERT_ID()", strlen("SELECT LAST_INSERT_ID()"));
|
rc= mysql_stmt_prepare(stmt, "SELECT LAST_INSERT_ID()", (unsigned long)strlen("SELECT LAST_INSERT_ID()"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_query(mysql, "INSERT INTO t1 VALUES (NULL)");
|
rc= mysql_query(mysql, "INSERT INTO t1 VALUES (NULL)");
|
||||||
@@ -2084,7 +2084,7 @@ static int test_bug36004(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "select 1", strlen("select 1"));
|
rc= mysql_stmt_prepare(stmt, "select 1", (unsigned long)strlen("select 1"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_UNLESS(mysql_warning_count(mysql) == 0, "No warning expected");
|
FAIL_UNLESS(mysql_warning_count(mysql) == 0, "No warning expected");
|
||||||
@@ -2101,7 +2101,7 @@ static int test_bug36004(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "drop table if exists inexistant", strlen("drop table if exists inexistant"));
|
rc= mysql_stmt_prepare(stmt, "drop table if exists inexistant", (unsigned long)strlen("drop table if exists inexistant"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
query_int_variable(mysql, "@@warning_count", &warning_count);
|
query_int_variable(mysql, "@@warning_count", &warning_count);
|
||||||
@@ -2126,22 +2126,22 @@ static int test_bug3796(MYSQL *mysql)
|
|||||||
|
|
||||||
/* Create and fill test table */
|
/* Create and fill test table */
|
||||||
stmt_text= "DROP TABLE IF EXISTS t1";
|
stmt_text= "DROP TABLE IF EXISTS t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "CREATE TABLE t1 (a INT, b VARCHAR(30))";
|
stmt_text= "CREATE TABLE t1 (a INT, b VARCHAR(30))";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "INSERT INTO t1 VALUES(1, 'ONE'), (2, 'TWO')";
|
stmt_text= "INSERT INTO t1 VALUES(1, 'ONE'), (2, 'TWO')";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
/* Create statement handle and prepare it with select */
|
/* Create statement handle and prepare it with select */
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
stmt_text= "SELECT concat(?, b) FROM t1";
|
stmt_text= "SELECT concat(?, b) FROM t1";
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
/* Bind input buffers */
|
/* Bind input buffers */
|
||||||
memset(my_bind, '\0', sizeof(my_bind));
|
memset(my_bind, '\0', sizeof(my_bind));
|
||||||
@@ -2179,7 +2179,7 @@ static int test_bug3796(MYSQL *mysql)
|
|||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
|
|
||||||
stmt_text= "DROP TABLE IF EXISTS t1";
|
stmt_text= "DROP TABLE IF EXISTS t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@@ -2200,7 +2200,7 @@ static int test_bug4026(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
stmt_text= "SELECT ?, ?";
|
stmt_text= "SELECT ?, ?";
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
/* Bind input buffers */
|
/* Bind input buffers */
|
||||||
memset(my_bind, '\0', sizeof(MYSQL_BIND) * 2);
|
memset(my_bind, '\0', sizeof(MYSQL_BIND) * 2);
|
||||||
@@ -2265,7 +2265,7 @@ static int test_bug4030(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
stmt_text= "SELECT '23:59:59.123456', '2003-12-31', "
|
stmt_text= "SELECT '23:59:59.123456', '2003-12-31', "
|
||||||
"'2003-12-31 23:59:59.123456'";
|
"'2003-12-31 23:59:59.123456'";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -2329,7 +2329,7 @@ static int test_bug4079(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
stmt_text= "SELECT 1 < (SELECT a FROM t1)";
|
stmt_text= "SELECT 1 < (SELECT a FROM t1)";
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
/* Execute the select statement */
|
/* Execute the select statement */
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -2367,7 +2367,7 @@ static int test_bug4172(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
stmt_text= "SELECT f, d, e FROM t1";
|
stmt_text= "SELECT f, d, e FROM t1";
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt); rc= mysql_stmt_execute(stmt);
|
check_stmt_rc(rc, stmt); rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
memset(my_bind, '\0', sizeof(my_bind)); my_bind[0].buffer_type= MYSQL_TYPE_STRING;
|
memset(my_bind, '\0', sizeof(my_bind)); my_bind[0].buffer_type= MYSQL_TYPE_STRING;
|
||||||
@@ -2388,7 +2388,7 @@ static int test_bug4172(MYSQL *mysql)
|
|||||||
mysql_stmt_store_result(stmt);
|
mysql_stmt_store_result(stmt);
|
||||||
rc= mysql_stmt_fetch(stmt);
|
rc= mysql_stmt_fetch(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
res= mysql_store_result(mysql);
|
res= mysql_store_result(mysql);
|
||||||
row= mysql_fetch_row(res);
|
row= mysql_fetch_row(res);
|
||||||
@@ -2412,20 +2412,20 @@ static int test_bug4231(MYSQL *mysql)
|
|||||||
|
|
||||||
|
|
||||||
stmt_text= "DROP TABLE IF EXISTS t1";
|
stmt_text= "DROP TABLE IF EXISTS t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "CREATE TABLE t1 (a int)";
|
stmt_text= "CREATE TABLE t1 (a int)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "INSERT INTO t1 VALUES (1)";
|
stmt_text= "INSERT INTO t1 VALUES (1)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
stmt_text= "SELECT a FROM t1 WHERE ? = ?";
|
stmt_text= "SELECT a FROM t1 WHERE ? = ?";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
/* Bind input buffers */
|
/* Bind input buffers */
|
||||||
memset(my_bind, '\0', sizeof(my_bind)); memset(tm, '\0', sizeof(tm));
|
memset(my_bind, '\0', sizeof(my_bind)); memset(tm, '\0', sizeof(tm));
|
||||||
@@ -2464,7 +2464,7 @@ static int test_bug4231(MYSQL *mysql)
|
|||||||
|
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
stmt_text= "DROP TABLE t1";
|
stmt_text= "DROP TABLE t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@@ -2483,7 +2483,7 @@ static int test_bug4236(MYSQL *mysql)
|
|||||||
/* mysql_stmt_execute() of statement with statement id= 0 crashed server */
|
/* mysql_stmt_execute() of statement with statement id= 0 crashed server */
|
||||||
stmt_text= "SELECT 1";
|
stmt_text= "SELECT 1";
|
||||||
/* We need to prepare statement to pass by possible check in libmysql */
|
/* We need to prepare statement to pass by possible check in libmysql */
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt); /* Hack to check that server works OK if statement wasn't found */
|
check_stmt_rc(rc, stmt); /* Hack to check that server works OK if statement wasn't found */
|
||||||
backup.stmt_id= stmt->stmt_id;
|
backup.stmt_id= stmt->stmt_id;
|
||||||
stmt->stmt_id= 0;
|
stmt->stmt_id= 0;
|
||||||
@@ -2494,7 +2494,7 @@ static int test_bug4236(MYSQL *mysql)
|
|||||||
mysql1= test_connect(NULL);
|
mysql1= test_connect(NULL);
|
||||||
stmt1= mysql_stmt_init(mysql1);
|
stmt1= mysql_stmt_init(mysql1);
|
||||||
stmt_text= "SELECT 2";
|
stmt_text= "SELECT 2";
|
||||||
rc= mysql_stmt_prepare(stmt1, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt1, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
stmt->stmt_id= stmt1->stmt_id;
|
stmt->stmt_id= stmt1->stmt_id;
|
||||||
@@ -2521,20 +2521,20 @@ static int test_bug5126(MYSQL *mysql)
|
|||||||
|
|
||||||
|
|
||||||
stmt_text= "DROP TABLE IF EXISTS t1";
|
stmt_text= "DROP TABLE IF EXISTS t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "CREATE TABLE t1 (a mediumint, b int)";
|
stmt_text= "CREATE TABLE t1 (a mediumint, b int)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "INSERT INTO t1 VALUES (8386608, 1)";
|
stmt_text= "INSERT INTO t1 VALUES (8386608, 1)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
stmt_text= "SELECT a, b FROM t1";
|
stmt_text= "SELECT a, b FROM t1";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -2606,7 +2606,7 @@ static int test_bug5194(MYSQL *mysql)
|
|||||||
|
|
||||||
|
|
||||||
stmt_text= "drop table if exists t1";
|
stmt_text= "drop table if exists t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
|
|
||||||
stmt_text= "create table if not exists t1"
|
stmt_text= "create table if not exists t1"
|
||||||
"(c1 float, c2 float, c3 float, c4 float, c5 float, c6 float, "
|
"(c1 float, c2 float, c3 float, c4 float, c5 float, c6 float, "
|
||||||
@@ -2651,7 +2651,7 @@ static int test_bug5194(MYSQL *mysql)
|
|||||||
"c235 float, c236 float, c237 float, c238 float, c239 float, c240 float, "
|
"c235 float, c236 float, c237 float, c238 float, c239 float, c240 float, "
|
||||||
"c241 float, c242 float, c243 float, c244 float, c245 float, c246 float, "
|
"c241 float, c242 float, c243 float, c244 float, c245 float, c246 float, "
|
||||||
"c247 float, c248 float, c249 float, c250 float)";
|
"c247 float, c248 float, c249 float, c250 float)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
my_bind= (MYSQL_BIND*) malloc(MAX_PARAM_COUNT * sizeof(MYSQL_BIND));
|
my_bind= (MYSQL_BIND*) malloc(MAX_PARAM_COUNT * sizeof(MYSQL_BIND));
|
||||||
@@ -2689,7 +2689,7 @@ static int test_bug5194(MYSQL *mysql)
|
|||||||
char *query_ptr;
|
char *query_ptr;
|
||||||
/* Create statement text for current number of rows */
|
/* Create statement text for current number of rows */
|
||||||
sprintf(query, query_template, param_str);
|
sprintf(query, query_template, param_str);
|
||||||
query_ptr= query + strlen(query);
|
query_ptr= query + (unsigned long)strlen(query);
|
||||||
for (i= 1; i < nrows; ++i)
|
for (i= 1; i < nrows; ++i)
|
||||||
{
|
{
|
||||||
memcpy(query_ptr, ", ", 2);
|
memcpy(query_ptr, ", ", 2);
|
||||||
@@ -2720,7 +2720,7 @@ static int test_bug5194(MYSQL *mysql)
|
|||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
free(my_bind);
|
free(my_bind);
|
||||||
stmt_text= "drop table t1";
|
stmt_text= "drop table t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@@ -2734,7 +2734,7 @@ static int test_bug5315(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt_text= "SELECT 1";
|
stmt_text= "SELECT 1";
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_change_user(mysql, username, password, schema);
|
rc= mysql_change_user(mysql, username, password, schema);
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
@@ -2746,7 +2746,7 @@ static int test_bug5315(MYSQL *mysql)
|
|||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -2776,7 +2776,7 @@ static int test_bug5399(MYSQL *mysql)
|
|||||||
{
|
{
|
||||||
sprintf(buff, "select %d", (int) (stmt - stmt_list));
|
sprintf(buff, "select %d", (int) (stmt - stmt_list));
|
||||||
*stmt= mysql_stmt_init(mysql);
|
*stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(*stmt, buff, strlen(buff));
|
rc= mysql_stmt_prepare(*stmt, buff, (unsigned long)strlen(buff));
|
||||||
check_stmt_rc(rc, *stmt); mysql_stmt_bind_result(*stmt, my_bind);
|
check_stmt_rc(rc, *stmt); mysql_stmt_bind_result(*stmt, my_bind);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2806,13 +2806,13 @@ static int test_bug6046(MYSQL *mysql)
|
|||||||
|
|
||||||
|
|
||||||
stmt_text= "DROP TABLE IF EXISTS t1";
|
stmt_text= "DROP TABLE IF EXISTS t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
stmt_text= "CREATE TABLE t1 (a int, b int)";
|
stmt_text= "CREATE TABLE t1 (a int, b int)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
stmt_text= "INSERT INTO t1 VALUES (1,1),(2,2),(3,1),(4,2)";
|
stmt_text= "INSERT INTO t1 VALUES (1,1),(2,2),(3,1),(4,2)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
@@ -2820,7 +2820,7 @@ static int test_bug6046(MYSQL *mysql)
|
|||||||
stmt_text= "SELECT t1.a FROM t1 NATURAL JOIN t1 as X1 "
|
stmt_text= "SELECT t1.a FROM t1 NATURAL JOIN t1 as X1 "
|
||||||
"WHERE t1.b > ? ORDER BY t1.a";
|
"WHERE t1.b > ? ORDER BY t1.a";
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
b= 1;
|
b= 1;
|
||||||
memset(my_bind, '\0', sizeof(my_bind)); my_bind[0].buffer= &b;
|
memset(my_bind, '\0', sizeof(my_bind)); my_bind[0].buffer= &b;
|
||||||
@@ -2852,13 +2852,13 @@ static int test_bug6049(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt_text= "SELECT MAKETIME(-25, 12, 12)";
|
stmt_text= "SELECT MAKETIME(-25, 12, 12)";
|
||||||
|
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
res= mysql_store_result(mysql);
|
res= mysql_store_result(mysql);
|
||||||
row= mysql_fetch_row(res);
|
row= mysql_fetch_row(res);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -2893,13 +2893,13 @@ static int test_bug6058(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt_text= "SELECT CAST('0000-00-00' AS DATE)";
|
stmt_text= "SELECT CAST('0000-00-00' AS DATE)";
|
||||||
|
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
res= mysql_store_result(mysql);
|
res= mysql_store_result(mysql);
|
||||||
row= mysql_fetch_row(res);
|
row= mysql_fetch_row(res);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -2930,7 +2930,7 @@ static int test_bug6059(MYSQL *mysql)
|
|||||||
stmt_text= "SELECT 'foo' INTO OUTFILE 'x.3'";
|
stmt_text= "SELECT 'foo' INTO OUTFILE 'x.3'";
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
FAIL_UNLESS(mysql_stmt_field_count(stmt) == 0, "");
|
FAIL_UNLESS(mysql_stmt_field_count(stmt) == 0, "");
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
@@ -2951,7 +2951,7 @@ static int test_bug6096(MYSQL *mysql)
|
|||||||
|
|
||||||
|
|
||||||
stmt_text= "drop table if exists t1";
|
stmt_text= "drop table if exists t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
mysql_query(mysql, "set sql_mode=''");
|
mysql_query(mysql, "set sql_mode=''");
|
||||||
@@ -2961,17 +2961,17 @@ static int test_bug6096(MYSQL *mysql)
|
|||||||
" c_double double, c_varchar varchar(20), "
|
" c_double double, c_varchar varchar(20), "
|
||||||
" c_char char(20), c_time time, c_date date, "
|
" c_char char(20), c_time time, c_date date, "
|
||||||
" c_datetime datetime)";
|
" c_datetime datetime)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
stmt_text= "insert into t1 values (-100, -20000, 30000000, 4, 8, 1.0, "
|
stmt_text= "insert into t1 values (-100, -20000, 30000000, 4, 8, 1.0, "
|
||||||
"2.0, 'abc', 'def', now(), now(), now())";
|
"2.0, 'abc', 'def', now(), now(), now())";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "select * from t1";
|
stmt_text= "select * from t1";
|
||||||
|
|
||||||
/* Run select in prepared and non-prepared mode and compare metadata */
|
/* Run select in prepared and non-prepared mode and compare metadata */
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
query_result= mysql_store_result(mysql);
|
query_result= mysql_store_result(mysql);
|
||||||
query_field_list= mysql_fetch_fields(query_result);
|
query_field_list= mysql_fetch_fields(query_result);
|
||||||
@@ -2979,7 +2979,7 @@ static int test_bug6096(MYSQL *mysql)
|
|||||||
query_field_count= mysql_num_fields(query_result);
|
query_field_count= mysql_num_fields(query_result);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt); rc= mysql_stmt_execute(stmt);
|
check_stmt_rc(rc, stmt); rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt); mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH,
|
check_stmt_rc(rc, stmt); mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH,
|
||||||
(void*) &update_max_length);
|
(void*) &update_max_length);
|
||||||
@@ -3014,7 +3014,7 @@ static int test_bug6096(MYSQL *mysql)
|
|||||||
mysql_free_result(query_result);
|
mysql_free_result(query_result);
|
||||||
mysql_free_result(stmt_metadata);
|
mysql_free_result(stmt_metadata);
|
||||||
stmt_text= "drop table t1";
|
stmt_text= "drop table t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@@ -3051,17 +3051,17 @@ static int test_bug8330(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt_text= "drop table if exists t1";
|
stmt_text= "drop table if exists t1";
|
||||||
/* in case some previos test failed */
|
/* in case some previos test failed */
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
stmt_text= "create table t1 (a int, b int)";
|
stmt_text= "create table t1 (a int, b int)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
memset(my_bind, '\0', sizeof(my_bind));
|
memset(my_bind, '\0', sizeof(my_bind));
|
||||||
for (i=0; i < 2; i++)
|
for (i=0; i < 2; i++)
|
||||||
{
|
{
|
||||||
stmt[i]= mysql_stmt_init(mysql);
|
stmt[i]= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt[i], query, strlen(query));
|
rc= mysql_stmt_prepare(stmt[i], query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt[i]);
|
check_stmt_rc(rc, stmt[i]);
|
||||||
my_bind[i].buffer_type= MYSQL_TYPE_LONG;
|
my_bind[i].buffer_type= MYSQL_TYPE_LONG;
|
||||||
my_bind[i].buffer= (void*) &lval[i];
|
my_bind[i].buffer= (void*) &lval[i];
|
||||||
@@ -3079,7 +3079,7 @@ static int test_bug8330(MYSQL *mysql)
|
|||||||
mysql_stmt_close(stmt[1]);
|
mysql_stmt_close(stmt[1]);
|
||||||
|
|
||||||
stmt_text= "drop table t1";
|
stmt_text= "drop table t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@@ -3114,7 +3114,7 @@ static int test_field_misc(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "SELECT @@autocommit", strlen("SELECT @@autocommit"));
|
rc= mysql_stmt_prepare(stmt, "SELECT @@autocommit", (unsigned long)strlen("SELECT @@autocommit"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -3139,7 +3139,7 @@ static int test_field_misc(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "SELECT @@max_error_count", strlen("SELECT @@max_error_count"));
|
rc= mysql_stmt_prepare(stmt, "SELECT @@max_error_count", (unsigned long)strlen("SELECT @@max_error_count"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
result= mysql_stmt_result_metadata(stmt);
|
result= mysql_stmt_result_metadata(stmt);
|
||||||
@@ -3166,7 +3166,7 @@ static int test_field_misc(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "SELECT @@max_allowed_packet", strlen("SELECT @@max_allowed_packet"));
|
rc= mysql_stmt_prepare(stmt, "SELECT @@max_allowed_packet", (unsigned long)strlen("SELECT @@max_allowed_packet"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
result= mysql_stmt_result_metadata(stmt);
|
result= mysql_stmt_result_metadata(stmt);
|
||||||
@@ -3193,7 +3193,7 @@ static int test_field_misc(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "SELECT @@sql_warnings", strlen("SELECT @@sql_warnings"));
|
rc= mysql_stmt_prepare(stmt, "SELECT @@sql_warnings", (unsigned long)strlen("SELECT @@sql_warnings"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
result= mysql_stmt_result_metadata(stmt);
|
result= mysql_stmt_result_metadata(stmt);
|
||||||
@@ -3277,7 +3277,7 @@ static int test_mem_overun(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "select * from t_mem_overun", strlen("select * from t_mem_overun"));
|
rc= mysql_stmt_prepare(stmt, "select * from t_mem_overun", (unsigned long)strlen("select * from t_mem_overun"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -3313,27 +3313,27 @@ static int test_bug8722(MYSQL *mysql)
|
|||||||
|
|
||||||
/* Prepare test data */
|
/* Prepare test data */
|
||||||
stmt_text= "drop table if exists t1";
|
stmt_text= "drop table if exists t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
stmt_text= "drop view if exists v1";
|
stmt_text= "drop view if exists v1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
stmt_text= "CREATE TABLE t1 (c1 varchar(10), c2 varchar(10), c3 varchar(10),"
|
stmt_text= "CREATE TABLE t1 (c1 varchar(10), c2 varchar(10), c3 varchar(10),"
|
||||||
" c4 varchar(10), c5 varchar(10), c6 varchar(10),"
|
" c4 varchar(10), c5 varchar(10), c6 varchar(10),"
|
||||||
" c7 varchar(10), c8 varchar(10), c9 varchar(10),"
|
" c7 varchar(10), c8 varchar(10), c9 varchar(10),"
|
||||||
"c10 varchar(10))";
|
"c10 varchar(10))";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
stmt_text= "INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10)";
|
stmt_text= "INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
stmt_text= "CREATE VIEW v1 AS SELECT * FROM t1";
|
stmt_text= "CREATE VIEW v1 AS SELECT * FROM t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
stmt_text= "select * from v1";
|
stmt_text= "select * from v1";
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
rc= mysql_stmt_prepare(stmt, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
stmt_text= "drop table if exists t1, v1";
|
stmt_text= "drop table if exists t1, v1";
|
||||||
@@ -3368,7 +3368,7 @@ static int test_decimal_bug(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "select c1 from test_decimal_bug where c1=?",
|
rc= mysql_stmt_prepare(stmt, "select c1 from test_decimal_bug where c1=?",
|
||||||
strlen("select c1 from test_decimal_bug where c1=?"));
|
(unsigned long)strlen("select c1 from test_decimal_bug where c1=?"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -3467,7 +3467,7 @@ static int test_explain_bug(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "explain test_explain", strlen("explain test_explain"));
|
rc= mysql_stmt_prepare(stmt, "explain test_explain", (unsigned long)strlen("explain test_explain"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -3548,7 +3548,7 @@ static int test_explain_bug(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "explain select id, name FROM test_explain", strlen("explain select id, name FROM test_explain"));
|
rc= mysql_stmt_prepare(stmt, "explain select id, name FROM test_explain", (unsigned long)strlen("explain select id, name FROM test_explain"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -3645,7 +3645,7 @@ static int test_sshort_bug(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "SELECT * FROM test_sshort", strlen("SELECT * FROM test_sshort"));
|
rc= mysql_stmt_prepare(stmt, "SELECT * FROM test_sshort", (unsigned long)strlen("SELECT * FROM test_sshort"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -3725,7 +3725,7 @@ static int test_stiny_bug(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, "SELECT * FROM test_stiny", strlen("SELECT * FROM test_stiny"));
|
rc= mysql_stmt_prepare(stmt, "SELECT * FROM test_stiny", (unsigned long)strlen("SELECT * FROM test_stiny"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -3792,7 +3792,7 @@ static int test_bug53311(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
for (i=0; i < 2; i++)
|
for (i=0; i < 2; i++)
|
||||||
@@ -3886,7 +3886,7 @@ static int test_conc_5(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, "couldn't allocate memory");
|
FAIL_IF(!stmt, "couldn't allocate memory");
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -3925,7 +3925,7 @@ static int test_conc141(MYSQL *mysql)
|
|||||||
"END");
|
"END");
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -3958,7 +3958,7 @@ static int test_conc154(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, stmtstr, strlen(stmtstr));
|
rc= mysql_stmt_prepare(stmt, stmtstr, (unsigned long)strlen(stmtstr));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -3977,7 +3977,7 @@ static int test_conc154(MYSQL *mysql)
|
|||||||
|
|
||||||
/* 2nd: empty result set with free_result */
|
/* 2nd: empty result set with free_result */
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, stmtstr, strlen(stmtstr));
|
rc= mysql_stmt_prepare(stmt, stmtstr, (unsigned long)strlen(stmtstr));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -4004,7 +4004,7 @@ static int test_conc154(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, stmtstr, strlen(stmtstr));
|
rc= mysql_stmt_prepare(stmt, stmtstr, (unsigned long)strlen(stmtstr));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -4023,7 +4023,7 @@ static int test_conc154(MYSQL *mysql)
|
|||||||
|
|
||||||
/* 4th non empty result set with free_result */
|
/* 4th non empty result set with free_result */
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, stmtstr, strlen(stmtstr));
|
rc= mysql_stmt_prepare(stmt, stmtstr, (unsigned long)strlen(stmtstr));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -4065,7 +4065,7 @@ static int test_conc155(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, "SELECT a FROM t1", strlen("SELECT a FROM t1"));
|
rc= mysql_stmt_prepare(stmt, "SELECT a FROM t1", (unsigned long)strlen("SELECT a FROM t1"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -4116,7 +4116,7 @@ static int test_conc168(MYSQL *mysql)
|
|||||||
bind.buffer_type= MYSQL_TYPE_STRING;
|
bind.buffer_type= MYSQL_TYPE_STRING;
|
||||||
bind.buffer_length= 100;
|
bind.buffer_length= 100;
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, "SELECT a FROM conc168", strlen("SELECT a FROM conc168"));
|
rc= mysql_stmt_prepare(stmt, "SELECT a FROM conc168", (unsigned long)strlen("SELECT a FROM conc168"));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -4171,7 +4171,7 @@ static int test_conc167(MYSQL *mysql)
|
|||||||
bind[2].buffer_type= MYSQL_TYPE_STRING;
|
bind[2].buffer_type= MYSQL_TYPE_STRING;
|
||||||
bind[2].buffer_length= 100;
|
bind[2].buffer_length= 100;
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_str, strlen(stmt_str));
|
rc= mysql_stmt_prepare(stmt, stmt_str, (unsigned long)strlen(stmt_str));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -4209,7 +4209,7 @@ static int test_conc177(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_str, strlen(stmt_str));
|
rc= mysql_stmt_prepare(stmt, stmt_str, (unsigned long)strlen(stmt_str));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -4242,7 +4242,7 @@ static int test_conc177(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_str, strlen(stmt_str));
|
rc= mysql_stmt_prepare(stmt, stmt_str, (unsigned long)strlen(stmt_str));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -4283,7 +4283,7 @@ static int test_conc179(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, stmtstr, strlen(stmtstr));
|
rc= mysql_stmt_prepare(stmt, stmtstr, (unsigned long)strlen(stmtstr));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_warning_count(mysql) < 2, "expected 2 or more warnings");
|
FAIL_IF(mysql_warning_count(mysql) < 2, "expected 2 or more warnings");
|
||||||
@@ -4362,7 +4362,7 @@ static int test_conc181(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, stmt_str, strlen(stmt_str));
|
rc= mysql_stmt_prepare(stmt, stmt_str, (unsigned long)strlen(stmt_str));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -4477,7 +4477,7 @@ static int test_conc205(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)(unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(my_bind, '\0', sizeof(my_bind));
|
memset(my_bind, '\0', sizeof(my_bind));
|
||||||
|
@@ -153,7 +153,7 @@ int test_sp_params(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, stmtstr, strlen(stmtstr));
|
rc= mysql_stmt_prepare(stmt, stmtstr, (unsigned long)strlen(stmtstr));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 3, "expected param_count=3");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 3, "expected param_count=3");
|
||||||
@@ -236,7 +236,7 @@ int test_sp_reset(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, stmtstr, strlen(stmtstr));
|
rc= mysql_stmt_prepare(stmt, stmtstr, (unsigned long)strlen(stmtstr));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_param_count(stmt) != 3, "expected param_count=3");
|
FAIL_IF(mysql_stmt_param_count(stmt) != 3, "expected param_count=3");
|
||||||
@@ -291,7 +291,7 @@ int test_sp_reset1(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, stmtstr, strlen(stmtstr));
|
rc= mysql_stmt_prepare(stmt, stmtstr, (unsigned long)strlen(stmtstr));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(tmp, 0, sizeof(tmp));
|
memset(tmp, 0, sizeof(tmp));
|
||||||
@@ -361,7 +361,7 @@ int test_sp_reset2(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, stmtstr, strlen(stmtstr));
|
rc= mysql_stmt_prepare(stmt, stmtstr, (unsigned long)strlen(stmtstr));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -443,7 +443,7 @@ int test_query(MYSQL *mysql)
|
|||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, stmtstr, strlen(stmtstr));
|
rc= mysql_stmt_prepare(stmt, stmtstr, (unsigned long)strlen(stmtstr));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
for (i=0; i < 1000; i++)
|
for (i=0; i < 1000; i++)
|
||||||
|
@@ -101,7 +101,7 @@ static int test_free_result(MYSQL *mysql)
|
|||||||
strcpy(query, "select * from test_free_result");
|
strcpy(query, "select * from test_free_result");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(my_bind, '\0', sizeof(my_bind));
|
memset(my_bind, '\0', sizeof(my_bind));
|
||||||
@@ -183,7 +183,7 @@ static int test_free_store_result(MYSQL *mysql)
|
|||||||
strcpy(query, "select * from test_free_result");
|
strcpy(query, "select * from test_free_result");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(my_bind, '\0', sizeof(my_bind));
|
memset(my_bind, '\0', sizeof(my_bind));
|
||||||
@@ -287,7 +287,7 @@ static int test_store_result(MYSQL *mysql)
|
|||||||
strcpy(query, "SELECT * FROM test_store_result");
|
strcpy(query, "SELECT * FROM test_store_result");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_bind_result(stmt, my_bind);
|
rc= mysql_stmt_bind_result(stmt, my_bind);
|
||||||
@@ -389,7 +389,7 @@ static int test_store_result1(MYSQL *mysql)
|
|||||||
strcpy(query, "SELECT * FROM test_store_result");
|
strcpy(query, "SELECT * FROM test_store_result");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
@@ -458,7 +458,7 @@ static int test_store_result2(MYSQL *mysql)
|
|||||||
strcpy((char *)query , "SELECT col1 FROM test_store_result where col1= ?");
|
strcpy((char *)query , "SELECT col1 FROM test_store_result where col1= ?");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_error(mysql));
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_bind_param(stmt, my_bind);
|
rc= mysql_stmt_bind_param(stmt, my_bind);
|
||||||
@@ -635,7 +635,7 @@ static int test_bug6761(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt_text= "CREATE TABLE t1 (a int, b char(255), c decimal)";
|
stmt_text= "CREATE TABLE t1 (a int, b char(255), c decimal)";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
res= mysql_list_fields(mysql, "t1", "%");
|
res= mysql_list_fields(mysql, "t1", "%");
|
||||||
@@ -643,7 +643,7 @@ static int test_bug6761(MYSQL *mysql)
|
|||||||
mysql_free_result(res);
|
mysql_free_result(res);
|
||||||
|
|
||||||
stmt_text= "DROP TABLE t1";
|
stmt_text= "DROP TABLE t1";
|
||||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
rc= mysql_real_query(mysql, stmt_text, (unsigned long)strlen(stmt_text));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
@@ -37,11 +37,11 @@ static int test_bug15752(MYSQL *mysql)
|
|||||||
rc= mysql_query(mysql, "create procedure p1() select 1");
|
rc= mysql_query(mysql, "create procedure p1() select 1");
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
rc= mysql_real_query(mysql, query, strlen(query));
|
rc= mysql_real_query(mysql, query, (unsigned long)strlen(query));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
mysql_free_result(mysql_store_result(mysql));
|
mysql_free_result(mysql_store_result(mysql));
|
||||||
|
|
||||||
rc= mysql_real_query(mysql, query, strlen(query));
|
rc= mysql_real_query(mysql, query, (unsigned long)strlen(query));
|
||||||
FAIL_UNLESS(rc && mysql_errno(mysql) == CR_COMMANDS_OUT_OF_SYNC, "Error expected");
|
FAIL_UNLESS(rc && mysql_errno(mysql) == CR_COMMANDS_OUT_OF_SYNC, "Error expected");
|
||||||
|
|
||||||
rc= mysql_next_result(mysql);
|
rc= mysql_next_result(mysql);
|
||||||
@@ -54,7 +54,7 @@ static int test_bug15752(MYSQL *mysql)
|
|||||||
|
|
||||||
for (i = 0; i < ITERATION_COUNT; i++)
|
for (i = 0; i < ITERATION_COUNT; i++)
|
||||||
{
|
{
|
||||||
rc= mysql_real_query(mysql, query, strlen(query));
|
rc= mysql_real_query(mysql, query, (unsigned long)strlen(query));
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
mysql_free_result(mysql_store_result(mysql));
|
mysql_free_result(mysql_store_result(mysql));
|
||||||
rc= mysql_next_result(mysql);
|
rc= mysql_next_result(mysql);
|
||||||
|
@@ -74,7 +74,7 @@ static int test_view(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
strcpy(str_data, "TEST");
|
strcpy(str_data, "TEST");
|
||||||
@@ -132,7 +132,7 @@ static int test_view_where(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
for (i= 0; i < 3; i++)
|
for (i= 0; i < 3; i++)
|
||||||
@@ -217,7 +217,7 @@ static int test_view_2where(MYSQL *mysql)
|
|||||||
my_bind[i].length = &length[i];
|
my_bind[i].length = &length[i];
|
||||||
}
|
}
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_bind_param(stmt, my_bind);
|
rc= mysql_stmt_bind_param(stmt, my_bind);
|
||||||
@@ -269,7 +269,7 @@ static int test_view_star(MYSQL *mysql)
|
|||||||
}
|
}
|
||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_bind_param(stmt, my_bind);
|
rc= mysql_stmt_bind_param(stmt, my_bind);
|
||||||
@@ -317,11 +317,11 @@ static int test_view_insert(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
insert_stmt= mysql_stmt_init(mysql);
|
insert_stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(insert_stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(insert_stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, insert_stmt);
|
check_stmt_rc(rc, insert_stmt);
|
||||||
query= "select * from t1";
|
query= "select * from t1";
|
||||||
select_stmt= mysql_stmt_init(mysql);
|
select_stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(select_stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(select_stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, select_stmt);
|
check_stmt_rc(rc, select_stmt);
|
||||||
|
|
||||||
memset(my_bind, '\0', sizeof(MYSQL_BIND));
|
memset(my_bind, '\0', sizeof(MYSQL_BIND));
|
||||||
@@ -377,7 +377,7 @@ static int test_left_join_view(MYSQL *mysql)
|
|||||||
rc= mysql_query(mysql,"create view v1 (x) as select a from t1 where a > 1");
|
rc= mysql_query(mysql,"create view v1 (x) as select a from t1 where a > 1");
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
for (i= 0; i < 3; i++)
|
for (i= 0; i < 3; i++)
|
||||||
@@ -449,7 +449,7 @@ static int test_view_insert_fields(MYSQL *mysql)
|
|||||||
my_bind[i].length= &l[i];
|
my_bind[i].length= &l[i];
|
||||||
}
|
}
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_bind_param(stmt, my_bind);
|
rc= mysql_stmt_bind_param(stmt, my_bind);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -460,7 +460,7 @@ static int test_view_insert_fields(MYSQL *mysql)
|
|||||||
|
|
||||||
query= "select * from t1";
|
query= "select * from t1";
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -603,7 +603,7 @@ static int test_bug11111(MYSQL *mysql)
|
|||||||
|
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
|
|
||||||
rc= mysql_stmt_prepare(stmt, query, strlen(query));
|
rc= mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
Reference in New Issue
Block a user