diff options
author | unknown <monty@mysql.com/narttu.mysql.fi> | 2006-12-15 00:51:37 +0200 |
---|---|---|
committer | unknown <monty@mysql.com/narttu.mysql.fi> | 2006-12-15 00:51:37 +0200 |
commit | f00257ddd0a2f392f9b80c9cd5c405017e3a9d63 (patch) | |
tree | 142bd488523fec48817d9fb2194f1a608eec00fc /tests | |
parent | 25226de9ea52d06667c2c7fbd99f5cd014764241 (diff) | |
download | mariadb-git-f00257ddd0a2f392f9b80c9cd5c405017e3a9d63.tar.gz |
Fixed compiler warnings detected by option -Wshadow and -Wunused:
- Removed not used variables and functions
- Added #ifdef around code that is not used
- Renamed variables and functions to avoid conflicts
- Removed some not used arguments
Fixed some class/struct warnings in ndb
Added define IS_LONGDATA() to simplify code in libmysql.c
I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes
BUILD/SETUP.sh:
Added printing of unused functions and variables.
Made it easy to test compiling with -Wshadow
BUILD/compile-pentium-gcov:
Added warnings
Mark binary with -gcov
client/mysql.cc:
Fixed warnings found with gcc -Wshadow
client/mysql_upgrade.c:
Fixed warnings found with gcc -Wshadow
client/mysqlbinlog.cc:
Fixed warnings found with gcc -Wshadow
client/mysqldump.c:
Fixed warnings found with gcc -Wshadow
client/mysqltest.c:
Fixed warnings found with gcc -Wshadow
client/sql_string.cc:
Fixed warnings found with gcc -Wshadow
Merged with sql/sql_string.cc
client/sql_string.h:
Fixed warnings found with gcc -Wshadow
Merged with sql/sql_string.h
cmd-line-utils/readline/display.c:
Fixed compiler warning
cmd-line-utils/readline/histexpand.c:
Fixed warnings found with gcc -Wshadow
cmd-line-utils/readline/input.c:
Fixed warnings found with gcc -Wshadow
cmd-line-utils/readline/text.c:
Fixed warnings found with gcc -Wshadow
cmd-line-utils/readline/vi_mode.c:
Fixed warnings found with gcc -Wshadow
dbug/dbug_analyze.c:
Fixed warnings found with gcc -Wshadow
extra/my_print_defaults.c:
Prefixed defaults_extra_file and defaults_group_suffix with 'my' to avoid conflicts with similar named local variables
extra/yassl/include/buffer.hpp:
Fixed compiler warnings
extra/yassl/include/crypto_wrapper.hpp:
Fixed compiler warnings
extra/yassl/include/yassl_imp.hpp:
Fixed compiler warnings
extra/yassl/include/yassl_int.hpp:
Fixed compiler warnings
extra/yassl/src/crypto_wrapper.cpp:
Fixed compiler warnings
extra/yassl/taocrypt/benchmark/benchmark.cpp:
Fixed warnings found with gcc -Wshadow
extra/yassl/taocrypt/include/algebra.hpp:
Fixed compiler warnings
extra/yassl/taocrypt/include/des.hpp:
Fixed compiler warnings
extra/yassl/taocrypt/include/hash.hpp:
Fixed compiler warnings
extra/yassl/taocrypt/include/hmac.hpp:
Fixed compiler warnings
extra/yassl/taocrypt/include/modarith.hpp:
Fixed compiler warnings
extra/yassl/taocrypt/include/modes.hpp:
Fixed compiler warnings
extra/yassl/taocrypt/include/rsa.hpp:
Fixed compiler warnings
extra/yassl/taocrypt/mySTL/list.hpp:
Fixed compiler warnings
extra/yassl/taocrypt/src/aes.cpp:
Fixed compiler warnings
extra/yassl/taocrypt/src/algebra.cpp:
Fixed compiler warnings
extra/yassl/taocrypt/src/asn.cpp:
Fixed compiler warnings
extra/yassl/taocrypt/test/test.cpp:
Fixed compiler warnings
extra/yassl/testsuite/testsuite.cpp:
Fixed compiler warnings
include/m_ctype.h:
Fixed warnings found with gcc -Wshadow
include/my_pthread.h:
Fixed warnings found with gcc -Wshadow
include/my_sys.h:
Fixed warnings found with gcc -Wshadow
include/my_time.h:
Fixed warnings found with gcc -Wshadow
include/mysql.h:
Fixed warnings found with gcc -Wshadow
Added define IS_LONGDATA() to simplify code in libmysql.c
libmysql/libmysql.c:
Fixed warnings found with gcc -Wshadow
(Mostly replaced bind -> my_bind and time -> my_time)
libmysqld/lib_sql.cc:
Removed not used variables and labels
myisam/ft_boolean_search.c:
Fixed warnings found with gcc -Wshadow
myisam/mi_open.c:
Fixed warnings found with gcc -Wshadow
myisam/mi_search.c:
Fixed warnings found with gcc -Wshadow
myisam/mi_unique.c:
Fixed compiler warning
myisam/myisampack.c:
Fixed warnings found with gcc -Wshadow
myisam/rt_index.c:
Remove not used variables
myisam/sort.c:
Fixed warnings found with gcc -Wshadow
mysql-test/r/mysqlcheck.result:
Remove databases and tables possible left by previous test
mysql-test/r/mysqltest.result:
New test results
mysql-test/t/mysql.test:
Coverage tests
mysql-test/t/mysqlbinlog.test:
Coverage tests
mysql-test/t/mysqlcheck.test:
Remove databases and tables possible left by previous test
mysql-test/t/mysqltest.test:
Coverage tests
mysys/default.c:
Prefixed defaults_file, defaults_group_suffix and defaults_extra_file with 'my' to avoid conflicts with local variables in some functions
mysys/mf_iocache2.c:
Fixed warnings found with gcc -Wshadow
mysys/mf_keycache.c:
Fixed warnings found with gcc -Wshadow
mysys/my_bitmap.c:
Fixed warnings found with gcc -Wshadow
mysys/sha1.c:
Fixed warnings found with gcc -Wshadow
ndb/include/kernel/signaldata/ArbitSignalData.hpp:
Fixed compiler warning
ndb/include/kernel/signaldata/DictTabInfo.hpp:
Fixed compiler warnings
ndb/include/ndbapi/NdbReceiver.hpp:
Fixed warnings found with gcc -Wshadow
ndb/include/transporter/TransporterDefinitions.hpp:
Fixed compiler warning
ndb/include/util/InputStream.hpp:
Fixed compiler warning
ndb/include/util/OutputStream.hpp:
Fixed compiler warning
ndb/include/util/SimpleProperties.hpp:
Fixed compiler warning
ndb/include/util/SocketAuthenticator.hpp:
Fixed compiler warning
ndb/include/util/SocketServer.hpp:
Fixed compiler warning
ndb/src/common/mgmcommon/ConfigRetriever.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/common/portlib/NdbTick.c:
Fixed warnings found with gcc -Wshadow
ndb/src/common/transporter/SHM_Transporter.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/common/transporter/TCP_Transporter.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/common/transporter/TCP_Transporter.hpp:
Fixed compiler warning
ndb/src/common/transporter/Transporter.cpp:
Removed not used variable
ndb/src/common/transporter/TransporterRegistry.cpp:
Removed not used variable
ndb/src/common/util/Bitmask.cpp:
Moved function to avoid warnings of not used function
ndb/src/common/util/ConfigValues.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/common/util/File.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/common/util/Properties.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/common/util/SocketClient.cpp:
Fixed wrong return value
ndb/src/common/util/random.c:
Fixed warnings found with gcc -Wshadow
ndb/src/common/util/socket_io.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/cw/cpcd/APIService.cpp:
Removed not used variable
ndb/src/cw/cpcd/main.cpp:
Removed not used variables
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
Fixed compiler warnings
ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Removed not used variables
ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
Fixed compiler warnings
ndb/src/kernel/blocks/dbdih/Dbdih.hpp:
Fixed compiler warnings
ndb/src/kernel/blocks/dblqh/Dblqh.hpp:
Fixed compiler warnings
ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
Removed not used variables
ndb/src/kernel/blocks/dbtc/Dbtc.hpp:
Fixed compiler warnings
ndb/src/kernel/blocks/dbtup/Dbtup.hpp:
Fixed compiler warnings
ndb/src/kernel/blocks/dbtup/DbtupScan.cpp:
Removed not used variable
ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp:
Removed not used variables
ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp:
Removed not used variables
ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp:
Removed not used variables
ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp:
Fixed compiler warnings
ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp:
Removed not used variables
ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp:
Fixed compiler warnings
ndb/src/kernel/blocks/qmgr/Qmgr.hpp:
Fixed compiler warnings
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp:
Removed not used variables
ndb/src/kernel/blocks/suma/Suma.cpp:
Removed not used variables
ndb/src/kernel/blocks/suma/Suma.hpp:
Fixed compiler warnings
ndb/src/kernel/vm/MetaData.hpp:
Fixed compiler warnings
ndb/src/mgmapi/LocalConfig.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/mgmapi/mgmapi.cpp:
Fixed warnings found with gcc -Wshadow
ndb/src/mgmclient/CommandInterpreter.cpp:
Removed not used variables
ndb/src/mgmsrv/ConfigInfo.cpp:
Fixed warnings found with gcc -Wshadow
Removed not used variables
ndb/src/mgmsrv/ConfigInfo.hpp:
Fixed warnings found with gcc -Wshadow
ndb/src/mgmsrv/InitConfigFileParser.cpp:
Prefixed defaults_file, defaults_group_suffix and defaults_extra_file with 'my' to avoid conflicts with local variables in some functions
ndb/src/mgmsrv/MgmtSrvr.cpp:
Removed not used variables and functions
ndb/src/mgmsrv/MgmtSrvr.hpp:
Fixed compiler warnings
ndb/src/mgmsrv/Services.cpp:
Removed not used variables and functions
ndb/src/mgmsrv/main.cpp:
Removed not used variable
ndb/src/ndbapi/ClusterMgr.hpp:
Fixed compiler warnings
ndb/src/ndbapi/Ndb.cpp:
Removed not used variables
ndb/src/ndbapi/NdbBlob.cpp:
Removed not used variables
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Removed not used variables
ndb/src/ndbapi/NdbIndexOperation.cpp:
Removed not used variables
ndb/src/ndbapi/NdbOperationDefine.cpp:
Removed not used variables
ndb/src/ndbapi/NdbOperationExec.cpp:
Removed not used variables
ndb/src/ndbapi/NdbOperationSearch.cpp:
Removed not used variables
ndb/src/ndbapi/NdbScanFilter.cpp:
Fixed compiler warning
ndb/src/ndbapi/NdbScanOperation.cpp:
Removed not used variables
ndb/src/ndbapi/SignalSender.cpp:
Removed not used variables
ndb/src/ndbapi/ndb_cluster_connection.cpp:
Removed not used variable
ndb/tools/delete_all.cpp:
Removed not used variable
ndb/tools/desc.cpp:
Removed not used variable
ndb/tools/drop_index.cpp:
Removed not used variable
ndb/tools/drop_tab.cpp:
Removed not used variable
ndb/tools/listTables.cpp:
Removed not used variable
ndb/tools/ndb_config.cpp:
Fixed warnings found with gcc -Wshadow
Added missing puts(desc)
ndb/tools/restore/Restore.hpp:
Changed delimiter to define instead of static variable, as the static variable caused a LOT of compiler warnings
Fixed compiler warning
ndb/tools/restore/consumer.hpp:
Fixed compiler warning
ndb/tools/restore/restore_main.cpp:
Fixed compiler warnings
ndb/tools/select_all.cpp:
Removed not used variables
ndb/tools/select_count.cpp:
Removed not used variable
server-tools/instance-manager/commands.h:
Fixed compiler warnings
server-tools/instance-manager/guardian.cc:
Fixed compiler warnings
server-tools/instance-manager/instance_options.cc:
Removed not used variables
server-tools/instance-manager/mysql_connection.cc:
Fixed compiler warnings
server-tools/instance-manager/options.cc:
Fixed compiler warnings
server-tools/instance-manager/options.h:
Fixed compiler warnings
server-tools/instance-manager/parse.cc:
Removed not used variable
server-tools/instance-manager/user_map.cc:
Fixed compiler warnings
server-tools/instance-manager/user_map.h:
Fixed compiler warnings
sql/field.cc:
Fixed compiler warnings
sql/field.h:
Fixed compiler warnings
sql/filesort.cc:
Fixed compiler warnings
sql/ha_archive.cc:
Removed table and share arguments from get_share() / free_share() to get rid of compiler warnings
sql/ha_archive.h:
Removed table and share arguments from get_share() / free_share() to get rid of compiler warnings
sql/ha_federated.cc:
Fixed compiler warnings
sql/ha_heap.cc:
Fixed compiler warnings
sql/ha_myisam.cc:
Fixed compiler warnings
sql/ha_myisammrg.cc:
Fixed compiler warnings
sql/ha_ndbcluster.cc:
Fixed compiler warnings
sql/handler.cc:
Fixed compiler warnings
sql/item.cc:
Fixed compiler warnings
sql/item.h:
Fixed compiler warnings
new_item() -> clone_item(), to avoid a lot of warnings with variable 'new_item'
el() -> element_index()
sql/item_cmpfunc.cc:
Fixed compiler warnings
sql/item_cmpfunc.h:
Fixed compiler warnings
sql/item_func.cc:
Fixed compiler warnings
sql/item_geofunc.cc:
Fixed compiler warnings
sql/item_row.h:
Fixed compiler warnings
sql/item_strfunc.cc:
Fixed compiler warnings
sql/item_subselect.cc:
Fixed compiler warnings
sql/item_subselect.h:
Fixed compiler warnings
sql/item_sum.cc:
Fixed compiler warnings
sql/item_timefunc.cc:
Fixed compiler warnings
sql/log.cc:
Fixed compiler warnings
More comments
Added #ifdef HAVE_REPLICATION
sql/log_event.cc:
Fixed compiler warnings
sql/log_event.h:
Fixed compiler warnings
sql/mysql_priv.h:
query_id -> global_query_id, to avoid a lot of clashes with function and class variables
start_time -> server_start_time
sql/mysqld.cc:
Fixed compiler warnings:
- Removed not used variables
- Added #ifndef EMBEDDED_LIBRARY
- Fixed shadow warnings
sql/net_serv.cc:
Fixed compiler warnings
sql/opt_range.cc:
range -> last_range to avoid shadow warnings
Removed not used function print_rowid()
sql/opt_range.h:
range -> last_range to avoid shadow warnings
sql/password.c:
Fixed compiler warnings
sql/protocol.cc:
Fixed compiler warnings
sql/repl_failsafe.cc:
Fixed compiler warnings
sql/set_var.cc:
Fixed compiler warnings
sql/set_var.h:
type() -> show_type()
Fixed compiler warnings
sql/slave.cc:
Fixed compiler warnings
sql/sp_head.cc:
Fixed compiler warnings
sql/sp_head.h:
Fixed compiler warnings
sql/spatial.cc:
Fixed compiler warnings
sql/spatial.h:
length() -> geom_length() to avoid compiler warnings
wkb_end -> wkb_last to avoid compiler warnings with local variables named 'wkb_end'
sql/sql_cache.h:
Fixed compiler warnings
sql/sql_class.cc:
Fixed compiler warnings
sql/sql_class.h:
log -> log_xid() to avoid compiler warnings
Fixed shadow compiler warnings
sql/sql_derived.cc:
Removed not used variable
sql/sql_insert.cc:
Fixed compiler warnings
sql/sql_lex.cc:
Fixed compiler warnings
sql/sql_lex.h:
res -> saved_error to make the meaning of the variable clear and avoid shadow warnings
sql/sql_load.cc:
Fixed compiler warnings
sql/sql_parse.cc:
Fixed compiler warnings
sql/sql_prepare.cc:
Fixed compiler warnings
sql/sql_select.cc:
Fixed compiler warnings
sql/sql_show.cc:
Fixed compiler warnings
sql/sql_string.cc:
Fixed compiler warnings
sql/sql_string.h:
Fixed compiler warnings
sql/sql_table.cc:
Fixed compiler warnings
sql/sql_trigger.cc:
Fixed compiler warnings
sql/sql_trigger.h:
table -> trigger_table to avoid warnings from local variables
sql/sql_union.cc:
Fixed compiler warnings
(mainly res -> saved_error)
sql-common/client.c:
Removed not used variable
sql-common/my_time.c:
Removed not used variable
time -> my_time
sql/sql_update.cc:
Removed not used variable
sql/sql_view.cc:
Removed not used variable
sql/sql_yacc.yy:
Removed not used variable
sql/table.cc:
Removed not used variable
sql/tztime.cc:
Removed not used variable
sql/unireg.cc:
Removed not used variable
strings/ctype-bin.c:
mblen -> mb_len to avoid compiler warnings with local variable mblen
strings/ctype-cp932.c:
Fixed compiler warnings
strings/ctype-eucjpms.c:
Fixed compiler warnings
strings/ctype-mb.c:
mblen -> mb_len to avoid compiler warnings with local variable mblen
strings/ctype-simple.c:
mblen -> mb_len to avoid compiler warnings with local variable mblen
exp -> exponent
strings/ctype-sjis.c:
Fixed compiler warnings
strings/ctype-uca.c:
mblen -> mb_len to avoid compiler warnings with local variable mblen
strings/ctype-ujis.c:
Fixed compiler warnings
strings/ctype-utf8.c:
Fixed compiler warnings
strings/decimal.c:
Fixed compiler warnings
strings/my_vsnprintf.c:
Added comment
strings/strtod.c:
Fixed compiler warnings
tests/mysql_client_test.c:
Fixed compiler warnings
(Biggest part of patch is to not get a conflict with global function 'bind')
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mysql_client_test.c | 2406 |
1 files changed, 1203 insertions, 1203 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index aa993230a7f..a233ee81b31 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -254,9 +254,9 @@ static my_bool check_have_innodb(MYSQL *conn) */ MYSQL_STMT *STDCALL -mysql_simple_prepare(MYSQL *mysql, const char *query) +mysql_simple_prepare(MYSQL *mysql_arg, const char *query) { - MYSQL_STMT *stmt= mysql_stmt_init(mysql); + MYSQL_STMT *stmt= mysql_stmt_init(mysql_arg); if (stmt && mysql_stmt_prepare(stmt, query, strlen(query))) { mysql_stmt_close(stmt); @@ -524,12 +524,12 @@ int my_process_result_set(MYSQL_RES *result) } -int my_process_result(MYSQL *mysql) +int my_process_result(MYSQL *mysql_arg) { MYSQL_RES *result; int row_count; - if (!(result= mysql_store_result(mysql))) + if (!(result= mysql_store_result(mysql_arg))) return 0; row_count= my_process_result_set(result); @@ -1567,7 +1567,7 @@ static void test_prepare() ulong length[7], len; my_bool is_null[7]; char llbuf[22]; - MYSQL_BIND bind[7]; + MYSQL_BIND my_bind[7]; char query[MAX_TEST_QUERY_LENGTH]; myheader("test_prepare"); @@ -1591,39 +1591,39 @@ static void test_prepare() verify_param_count(stmt, 7); - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); /* tinyint */ - bind[0].buffer_type= MYSQL_TYPE_TINY; - bind[0].buffer= (void *)&tiny_data; + my_bind[0].buffer_type= MYSQL_TYPE_TINY; + my_bind[0].buffer= (void *)&tiny_data; /* string */ - bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (void *)str_data; - bind[1].buffer_length= 1000; /* Max string length */ + my_bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].buffer= (void *)str_data; + my_bind[1].buffer_length= 1000; /* Max string length */ /* integer */ - bind[2].buffer_type= MYSQL_TYPE_LONG; - bind[2].buffer= (void *)&int_data; + my_bind[2].buffer_type= MYSQL_TYPE_LONG; + my_bind[2].buffer= (void *)&int_data; /* short */ - bind[3].buffer_type= MYSQL_TYPE_SHORT; - bind[3].buffer= (void *)&small_data; + my_bind[3].buffer_type= MYSQL_TYPE_SHORT; + my_bind[3].buffer= (void *)&small_data; /* bigint */ - bind[4].buffer_type= MYSQL_TYPE_LONGLONG; - bind[4].buffer= (void *)&big_data; + my_bind[4].buffer_type= MYSQL_TYPE_LONGLONG; + my_bind[4].buffer= (void *)&big_data; /* float */ - bind[5].buffer_type= MYSQL_TYPE_FLOAT; - bind[5].buffer= (void *)&real_data; + my_bind[5].buffer_type= MYSQL_TYPE_FLOAT; + my_bind[5].buffer= (void *)&real_data; /* double */ - bind[6].buffer_type= MYSQL_TYPE_DOUBLE; - bind[6].buffer= (void *)&double_data; + my_bind[6].buffer_type= MYSQL_TYPE_DOUBLE; + my_bind[6].buffer= (void *)&double_data; - for (i= 0; i < (int) array_elements(bind); i++) + for (i= 0; i < (int) array_elements(my_bind); i++) { - bind[i].length= &length[i]; - bind[i].is_null= &is_null[i]; + my_bind[i].length= &length[i]; + my_bind[i].is_null= &is_null[i]; is_null[i]= 0; } - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); int_data= 320; @@ -1658,7 +1658,7 @@ static void test_prepare() stmt= mysql_simple_prepare(mysql, "SELECT * FROM my_prepare"); check_stmt(stmt); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); /* get the result */ @@ -1740,7 +1740,7 @@ static void test_double_compare() char real_data[10], tiny_data; double double_data; MYSQL_RES *result; - MYSQL_BIND bind[3]; + MYSQL_BIND my_bind[3]; ulong length[3]; char query[MAX_TEST_QUERY_LENGTH]; @@ -1768,27 +1768,27 @@ static void test_double_compare() verify_param_count(stmt, 3); /* Always bzero bind array because there can be internal members */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); /* tinyint */ - bind[0].buffer_type= MYSQL_TYPE_TINY; - bind[0].buffer= (void *)&tiny_data; + my_bind[0].buffer_type= MYSQL_TYPE_TINY; + my_bind[0].buffer= (void *)&tiny_data; /* string->float */ - bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (void *)&real_data; - bind[1].buffer_length= sizeof(real_data); - bind[1].length= &length[1]; + my_bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].buffer= (void *)&real_data; + my_bind[1].buffer_length= sizeof(real_data); + my_bind[1].length= &length[1]; length[1]= 10; /* double */ - bind[2].buffer_type= MYSQL_TYPE_DOUBLE; - bind[2].buffer= (void *)&double_data; + my_bind[2].buffer_type= MYSQL_TYPE_DOUBLE; + my_bind[2].buffer= (void *)&double_data; tiny_data= 1; strmov(real_data, "10.2"); double_data= 34.5; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -1823,7 +1823,7 @@ static void test_null() MYSQL_STMT *stmt; int rc; uint nData; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; my_bool is_null[2]; char query[MAX_TEST_QUERY_LENGTH]; @@ -1847,14 +1847,14 @@ static void test_null() verify_param_count(stmt, 2); /* Always bzero all members of bind parameter */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].is_null= &is_null[0]; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].is_null= &is_null[0]; is_null[0]= 1; - bind[1]= bind[0]; + my_bind[1]= my_bind[0]; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); /* now, execute the prepared statement to insert 10 records.. */ @@ -1865,11 +1865,11 @@ static void test_null() } /* Re-bind with MYSQL_TYPE_NULL */ - bind[0].buffer_type= MYSQL_TYPE_NULL; + my_bind[0].buffer_type= MYSQL_TYPE_NULL; is_null[0]= 0; /* reset */ - bind[1]= bind[0]; + my_bind[1]= my_bind[0]; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); for (nData= 0; nData<10; nData++) @@ -1889,12 +1889,12 @@ static void test_null() DIE_UNLESS((int) nData == rc); /* Fetch results */ - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *)&nData; /* this buffer won't be altered */ - bind[0].length= 0; - bind[1]= bind[0]; - bind[0].is_null= &is_null[0]; - bind[1].is_null= &is_null[1]; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&nData; /* this buffer won't be altered */ + my_bind[0].length= 0; + my_bind[1]= my_bind[0]; + my_bind[0].is_null= &is_null[0]; + my_bind[1].is_null= &is_null[1]; stmt= mysql_simple_prepare(mysql, "SELECT * FROM test_null"); check_stmt(stmt); @@ -1902,7 +1902,7 @@ static void test_null() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= 0; @@ -2001,7 +2001,7 @@ static void test_fetch_null() MYSQL_STMT *stmt; int rc; int i, nData; - MYSQL_BIND bind[11]; + MYSQL_BIND my_bind[11]; ulong length[11]; my_bool is_null[11]; char query[MAX_TEST_QUERY_LENGTH]; @@ -2029,14 +2029,14 @@ static void test_fetch_null() myquery(rc); /* fetch */ - bzero((char*) bind, sizeof(bind)); - for (i= 0; i < (int) array_elements(bind); i++) + bzero((char*) my_bind, sizeof(my_bind)); + for (i= 0; i < (int) array_elements(my_bind); i++) { - bind[i].buffer_type= MYSQL_TYPE_LONG; - bind[i].is_null= &is_null[i]; - bind[i].length= &length[i]; + my_bind[i].buffer_type= MYSQL_TYPE_LONG; + my_bind[i].is_null= &is_null[i]; + my_bind[i].length= &length[i]; } - bind[i-1].buffer= (void *)&nData; /* Last column is not null */ + my_bind[i-1].buffer= (void *)&nData; /* Last column is not null */ strmov((char *)query , "SELECT * FROM test_fetch_null"); @@ -2046,7 +2046,7 @@ static void test_fetch_null() stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -2231,7 +2231,7 @@ static void test_select() int rc; char szData[25]; int nData= 1; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; ulong length[2]; char query[MAX_TEST_QUERY_LENGTH]; @@ -2265,21 +2265,21 @@ static void test_select() verify_param_count(stmt, 2); /* Always bzero all members of bind parameter */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); /* string data */ nData= 10; strmov(szData, (char *)"venu"); - bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (void *)szData; - bind[1].buffer_length= 4; - bind[1].length= &length[1]; + my_bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].buffer= (void *)szData; + my_bind[1].buffer_length= 4; + my_bind[1].length= &length[1]; length[1]= 4; - bind[0].buffer= (void *)&nData; - bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&nData; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -2301,7 +2301,7 @@ static void test_ps_conj_select() { MYSQL_STMT *stmt; int rc; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; int32 int_data; char str_data[32]; unsigned long str_length; @@ -2327,17 +2327,17 @@ static void test_ps_conj_select() verify_param_count(stmt, 2); /* Always bzero all members of bind parameter */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *)&int_data; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&int_data; - bind[1].buffer_type= MYSQL_TYPE_VAR_STRING; - bind[1].buffer= (void *)str_data; - bind[1].buffer_length= array_elements(str_data); - bind[1].length= &str_length; + my_bind[1].buffer_type= MYSQL_TYPE_VAR_STRING; + my_bind[1].buffer= (void *)str_data; + my_bind[1].buffer_length= array_elements(str_data); + my_bind[1].length= &str_length; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); int_data= 1; @@ -2360,7 +2360,7 @@ static void test_bug1115() { MYSQL_STMT *stmt; int rc; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; ulong length[1]; char szData[11]; char query[MAX_TEST_QUERY_LENGTH]; @@ -2410,16 +2410,16 @@ session_id char(9) NOT NULL, \ verify_param_count(stmt, 1); /* Always bzero all members of bind parameter */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); strmov(szData, (char *)"abc"); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *)szData; - bind[0].buffer_length= 10; - bind[0].length= &length[0]; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *)szData; + my_bind[0].buffer_length= 10; + my_bind[0].length= &length[0]; length[0]= 3; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -2429,14 +2429,14 @@ session_id char(9) NOT NULL, \ DIE_UNLESS(rc == 1); strmov(szData, (char *)"venu"); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *)szData; - bind[0].buffer_length= 10; - bind[0].length= &length[0]; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *)szData; + my_bind[0].buffer_length= 10; + my_bind[0].length= &length[0]; length[0]= 4; - bind[0].is_null= 0; + my_bind[0].is_null= 0; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -2446,14 +2446,14 @@ session_id char(9) NOT NULL, \ DIE_UNLESS(rc == 0); strmov(szData, (char *)"abc"); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *)szData; - bind[0].buffer_length= 10; - bind[0].length= &length[0]; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *)szData; + my_bind[0].buffer_length= 10; + my_bind[0].length= &length[0]; length[0]= 3; - bind[0].is_null= 0; + my_bind[0].is_null= 0; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -2472,7 +2472,7 @@ static void test_bug1180() { MYSQL_STMT *stmt; int rc; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; ulong length[1]; char szData[11]; char query[MAX_TEST_QUERY_LENGTH]; @@ -2495,17 +2495,17 @@ static void test_bug1180() verify_param_count(stmt, 1); /* Always bzero all members of bind parameter */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); strmov(szData, (char *)"abc"); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *)szData; - bind[0].buffer_length= 10; - bind[0].length= &length[0]; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *)szData; + my_bind[0].buffer_length= 10; + my_bind[0].length= &length[0]; length[0]= 3; - bind[0].is_null= 0; + my_bind[0].is_null= 0; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -2515,14 +2515,14 @@ static void test_bug1180() DIE_UNLESS(rc == 0); strmov(szData, (char *)"1111"); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *)szData; - bind[0].buffer_length= 10; - bind[0].length= &length[0]; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *)szData; + my_bind[0].buffer_length= 10; + my_bind[0].length= &length[0]; length[0]= 4; - bind[0].is_null= 0; + my_bind[0].is_null= 0; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -2532,14 +2532,14 @@ static void test_bug1180() DIE_UNLESS(rc == 1); strmov(szData, (char *)"abc"); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *)szData; - bind[0].buffer_length= 10; - bind[0].length= &length[0]; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *)szData; + my_bind[0].buffer_length= 10; + my_bind[0].length= &length[0]; length[0]= 3; - bind[0].is_null= 0; + my_bind[0].is_null= 0; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -2562,7 +2562,7 @@ static void test_bug1644() MYSQL_STMT *stmt; MYSQL_RES *result; MYSQL_ROW row; - MYSQL_BIND bind[4]; + MYSQL_BIND my_bind[4]; int num; my_bool isnull; int rc, i; @@ -2584,18 +2584,18 @@ static void test_bug1644() verify_param_count(stmt, 4); /* Always bzero all members of bind parameter */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); num= 22; isnull= 0; for (i= 0 ; i < 4 ; i++) { - bind[i].buffer_type= MYSQL_TYPE_LONG; - bind[i].buffer= (void *)# - bind[i].is_null= &isnull; + my_bind[i].buffer_type= MYSQL_TYPE_LONG; + my_bind[i].buffer= (void *)# + my_bind[i].is_null= &isnull; } - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -2603,9 +2603,9 @@ static void test_bug1644() isnull= 1; for (i= 0 ; i < 4 ; i++) - bind[i].is_null= &isnull; + my_bind[i].is_null= &isnull; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -2614,9 +2614,9 @@ static void test_bug1644() isnull= 0; num= 88; for (i= 0 ; i < 4 ; i++) - bind[i].is_null= &isnull; + my_bind[i].is_null= &isnull; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -2733,7 +2733,7 @@ static void test_simple_update() char szData[25]; int nData= 1; MYSQL_RES *result; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; ulong length[2]; char query[MAX_TEST_QUERY_LENGTH]; @@ -2765,19 +2765,19 @@ static void test_simple_update() verify_param_count(stmt, 2); /* Always bzero all members of bind parameter */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); nData= 1; - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= szData; /* string data */ - bind[0].buffer_length= sizeof(szData); - bind[0].length= &length[0]; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= szData; /* string data */ + my_bind[0].buffer_length= sizeof(szData); + my_bind[0].length= &length[0]; length[0]= my_sprintf(szData, (szData, "updated-data")); - bind[1].buffer= (void *) &nData; - bind[1].buffer_type= MYSQL_TYPE_LONG; + my_bind[1].buffer= (void *) &nData; + my_bind[1].buffer_type= MYSQL_TYPE_LONG; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -2812,7 +2812,7 @@ static void test_long_data() int rc, int_data; char *data= NullS; MYSQL_RES *result; - MYSQL_BIND bind[3]; + MYSQL_BIND my_bind[3]; char query[MAX_TEST_QUERY_LENGTH]; myheader("test_long_data"); @@ -2838,15 +2838,15 @@ static void test_long_data() verify_param_count(stmt, 3); /* Always bzero all members of bind parameter */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer= (void *)&int_data; - bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&int_data; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[2]= bind[1]; - rc= mysql_stmt_bind_param(stmt, bind); + my_bind[2]= my_bind[1]; + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); int_data= 999; @@ -2898,7 +2898,7 @@ static void test_long_data_str() long length; ulong length1; MYSQL_RES *result; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; my_bool is_null[2]; char query[MAX_TEST_QUERY_LENGTH]; @@ -2920,20 +2920,20 @@ static void test_long_data_str() verify_param_count(stmt, 2); /* Always bzero all members of bind parameter */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer= (void *)&length; - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].is_null= &is_null[0]; + my_bind[0].buffer= (void *)&length; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].is_null= &is_null[0]; is_null[0]= 0; length= 0; - bind[1].buffer= data; /* string data */ - bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].length= &length1; - bind[1].is_null= &is_null[1]; + my_bind[1].buffer= data; /* string data */ + my_bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].length= &length1; + my_bind[1].is_null= &is_null[1]; is_null[1]= 0; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); length= 40; @@ -2991,7 +2991,7 @@ static void test_long_data_str1() ulong max_blob_length, blob_length, length1; my_bool true_value; MYSQL_RES *result; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; MYSQL_FIELD *field; char query[MAX_TEST_QUERY_LENGTH]; @@ -3013,18 +3013,18 @@ static void test_long_data_str1() verify_param_count(stmt, 2); /* Always bzero all members of bind parameter */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer= data; /* string data */ - bind[0].buffer_length= sizeof(data); - bind[0].length= &length1; - bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= data; /* string data */ + my_bind[0].buffer_length= sizeof(data); + my_bind[0].length= &length1; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; length1= 0; - bind[1]= bind[0]; - bind[1].buffer_type= MYSQL_TYPE_BLOB; + my_bind[1]= my_bind[0]; + my_bind[1].buffer_type= MYSQL_TYPE_BLOB; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); length= my_sprintf(data, (data, "MySQL AB")); @@ -3105,29 +3105,29 @@ static void test_long_data_str1() DIE_UNLESS(field->max_length == max_blob_length); /* Fetch results into a data buffer that is smaller than data */ - bzero((char*) bind, sizeof(*bind)); - bind[0].buffer_type= MYSQL_TYPE_BLOB; - bind[0].buffer= (void *) &data; /* this buffer won't be altered */ - bind[0].buffer_length= 16; - bind[0].length= &blob_length; - bind[0].error= &bind[0].error_value; - rc= mysql_stmt_bind_result(stmt, bind); + bzero((char*) my_bind, sizeof(*my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_BLOB; + my_bind[0].buffer= (void *) &data; /* this buffer won't be altered */ + my_bind[0].buffer_length= 16; + my_bind[0].length= &blob_length; + my_bind[0].error= &my_bind[0].error_value; + rc= mysql_stmt_bind_result(stmt, my_bind); data[16]= 0; rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == MYSQL_DATA_TRUNCATED); - DIE_UNLESS(bind[0].error_value); + DIE_UNLESS(my_bind[0].error_value); DIE_UNLESS(strlen(data) == 16); DIE_UNLESS(blob_length == max_blob_length); /* Fetch all data */ - bzero((char*) (bind+1), sizeof(*bind)); - bind[1].buffer_type= MYSQL_TYPE_BLOB; - bind[1].buffer= (void *) &data; /* this buffer won't be altered */ - bind[1].buffer_length= sizeof(data); - bind[1].length= &blob_length; + bzero((char*) (my_bind+1), sizeof(*my_bind)); + my_bind[1].buffer_type= MYSQL_TYPE_BLOB; + my_bind[1].buffer= (void *) &data; /* this buffer won't be altered */ + my_bind[1].buffer_length= sizeof(data); + my_bind[1].length= &blob_length; bzero(data, sizeof(data)); - mysql_stmt_fetch_column(stmt, bind+1, 0, 0); + mysql_stmt_fetch_column(stmt, my_bind+1, 0, 0); DIE_UNLESS(strlen(data) == max_blob_length); mysql_free_result(result); @@ -3148,7 +3148,7 @@ static void test_long_data_bin() char data[255]; long length; MYSQL_RES *result; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; char query[MAX_TEST_QUERY_LENGTH]; @@ -3170,15 +3170,15 @@ static void test_long_data_bin() verify_param_count(stmt, 2); /* Always bzero all members of bind parameter */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer= (void *)&length; - bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&length; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; length= 0; - bind[1].buffer= data; /* string data */ - bind[1].buffer_type= MYSQL_TYPE_LONG_BLOB; - rc= mysql_stmt_bind_param(stmt, bind); + my_bind[1].buffer= data; /* string data */ + my_bind[1].buffer_type= MYSQL_TYPE_LONG_BLOB; + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); length= 10; @@ -3227,7 +3227,7 @@ static void test_simple_delete() char szData[30]= {0}; int nData= 1; MYSQL_RES *result; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; ulong length[2]; char query[MAX_TEST_QUERY_LENGTH]; @@ -3260,20 +3260,20 @@ static void test_simple_delete() verify_param_count(stmt, 2); /* Always bzero all members of bind parameter */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); nData= 1; strmov(szData, "MySQL"); - bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= szData; /* string data */ - bind[1].buffer_length= sizeof(szData); - bind[1].length= &length[1]; + my_bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].buffer= szData; /* string data */ + my_bind[1].buffer_length= sizeof(szData); + my_bind[1].length= &length[1]; length[1]= 5; - bind[0].buffer= (void *)&nData; - bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&nData; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -3310,7 +3310,7 @@ static void test_update() char szData[25]; int nData= 1; MYSQL_RES *result; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; ulong length[2]; char query[MAX_TEST_QUERY_LENGTH]; @@ -3334,19 +3334,19 @@ static void test_update() verify_param_count(stmt, 2); /* Always bzero all members of bind parameter */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); /* string data */ - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= szData; - bind[0].buffer_length= sizeof(szData); - bind[0].length= &length[0]; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= szData; + my_bind[0].buffer_length= sizeof(szData); + my_bind[0].length= &length[0]; length[0]= my_sprintf(szData, (szData, "inserted-data")); - bind[1].buffer= (void *)&nData; - bind[1].buffer_type= MYSQL_TYPE_LONG; + my_bind[1].buffer= (void *)&nData; + my_bind[1].buffer_type= MYSQL_TYPE_LONG; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); nData= 100; @@ -3364,18 +3364,18 @@ static void test_update() nData= 100; /* Always bzero all members of bind parameter */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= szData; - bind[0].buffer_length= sizeof(szData); - bind[0].length= &length[0]; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= szData; + my_bind[0].buffer_length= sizeof(szData); + my_bind[0].length= &length[0]; length[0]= my_sprintf(szData, (szData, "updated-data")); - bind[1].buffer= (void *)&nData; - bind[1].buffer_type= MYSQL_TYPE_LONG; + my_bind[1].buffer= (void *)&nData; + my_bind[1].buffer_type= MYSQL_TYPE_LONG; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -3459,7 +3459,7 @@ static void test_bind_result() int nData; ulong length1; char szData[100]; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; my_bool is_null[2]; myheader("test_bind_result"); @@ -3484,21 +3484,21 @@ static void test_bind_result() /* fetch */ - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *) &nData; /* integer data */ - bind[0].is_null= &is_null[0]; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *) &nData; /* integer data */ + my_bind[0].is_null= &is_null[0]; - bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= szData; /* string data */ - bind[1].buffer_length= sizeof(szData); - bind[1].length= &length1; - bind[1].is_null= &is_null[1]; + my_bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].buffer= szData; /* string data */ + my_bind[1].buffer_length= sizeof(szData); + my_bind[1].length= &length1; + my_bind[1].is_null= &is_null[1]; stmt= mysql_simple_prepare(mysql, "SELECT * FROM test_bind_result"); check_stmt(stmt); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -3552,7 +3552,7 @@ static void test_bind_result_ext() double d_data; char szData[20], bData[20]; ulong szLength, bLength; - MYSQL_BIND bind[8]; + MYSQL_BIND my_bind[8]; ulong length[8]; my_bool is_null[8]; char llbuf[22]; @@ -3577,45 +3577,45 @@ static void test_bind_result_ext() rc= mysql_commit(mysql); myquery(rc); - bzero((char*) bind, sizeof(bind)); - for (i= 0; i < (int) array_elements(bind); i++) + bzero((char*) my_bind, sizeof(my_bind)); + for (i= 0; i < (int) array_elements(my_bind); i++) { - bind[i].length= &length[i]; - bind[i].is_null= &is_null[i]; + my_bind[i].length= &length[i]; + my_bind[i].is_null= &is_null[i]; } - bind[0].buffer_type= MYSQL_TYPE_TINY; - bind[0].buffer= (void *)&t_data; + my_bind[0].buffer_type= MYSQL_TYPE_TINY; + my_bind[0].buffer= (void *)&t_data; - bind[1].buffer_type= MYSQL_TYPE_SHORT; - bind[2].buffer_type= MYSQL_TYPE_LONG; + my_bind[1].buffer_type= MYSQL_TYPE_SHORT; + my_bind[2].buffer_type= MYSQL_TYPE_LONG; - bind[3].buffer_type= MYSQL_TYPE_LONGLONG; - bind[1].buffer= (void *)&s_data; + my_bind[3].buffer_type= MYSQL_TYPE_LONGLONG; + my_bind[1].buffer= (void *)&s_data; - bind[2].buffer= (void *)&i_data; - bind[3].buffer= (void *)&b_data; + my_bind[2].buffer= (void *)&i_data; + my_bind[3].buffer= (void *)&b_data; - bind[4].buffer_type= MYSQL_TYPE_FLOAT; - bind[4].buffer= (void *)&f_data; + my_bind[4].buffer_type= MYSQL_TYPE_FLOAT; + my_bind[4].buffer= (void *)&f_data; - bind[5].buffer_type= MYSQL_TYPE_DOUBLE; - bind[5].buffer= (void *)&d_data; + my_bind[5].buffer_type= MYSQL_TYPE_DOUBLE; + my_bind[5].buffer= (void *)&d_data; - bind[6].buffer_type= MYSQL_TYPE_STRING; - bind[6].buffer= (void *)szData; - bind[6].buffer_length= sizeof(szData); - bind[6].length= &szLength; + my_bind[6].buffer_type= MYSQL_TYPE_STRING; + my_bind[6].buffer= (void *)szData; + my_bind[6].buffer_length= sizeof(szData); + my_bind[6].length= &szLength; - bind[7].buffer_type= MYSQL_TYPE_TINY_BLOB; - bind[7].buffer= (void *)&bData; - bind[7].length= &bLength; - bind[7].buffer_length= sizeof(bData); + my_bind[7].buffer_type= MYSQL_TYPE_TINY_BLOB; + my_bind[7].buffer= (void *)&bData; + my_bind[7].length= &bLength; + my_bind[7].buffer_length= sizeof(bData); stmt= mysql_simple_prepare(mysql, "select * from test_bind_result"); check_stmt(stmt); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -3673,7 +3673,7 @@ static void test_bind_result_ext1() long bData; char d_data[20]; double szData; - MYSQL_BIND bind[8]; + MYSQL_BIND my_bind[8]; ulong length[8]; my_bool is_null[8]; myheader("test_bind_result_ext1"); @@ -3696,57 +3696,57 @@ static void test_bind_result_ext1() rc= mysql_commit(mysql); myquery(rc); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *) t_data; - bind[0].buffer_length= sizeof(t_data); - bind[0].error= &bind[0].error_value; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *) t_data; + my_bind[0].buffer_length= sizeof(t_data); + my_bind[0].error= &my_bind[0].error_value; - bind[1].buffer_type= MYSQL_TYPE_FLOAT; - bind[1].buffer= (void *)&s_data; - bind[1].buffer_length= 0; - bind[1].error= &bind[1].error_value; + my_bind[1].buffer_type= MYSQL_TYPE_FLOAT; + my_bind[1].buffer= (void *)&s_data; + my_bind[1].buffer_length= 0; + my_bind[1].error= &my_bind[1].error_value; - bind[2].buffer_type= MYSQL_TYPE_SHORT; - bind[2].buffer= (void *)&i_data; - bind[2].buffer_length= 0; - bind[2].error= &bind[2].error_value; + my_bind[2].buffer_type= MYSQL_TYPE_SHORT; + my_bind[2].buffer= (void *)&i_data; + my_bind[2].buffer_length= 0; + my_bind[2].error= &my_bind[2].error_value; - bind[3].buffer_type= MYSQL_TYPE_TINY; - bind[3].buffer= (void *)&b_data; - bind[3].buffer_length= 0; - bind[3].error= &bind[3].error_value; + my_bind[3].buffer_type= MYSQL_TYPE_TINY; + my_bind[3].buffer= (void *)&b_data; + my_bind[3].buffer_length= 0; + my_bind[3].error= &my_bind[3].error_value; - bind[4].buffer_type= MYSQL_TYPE_LONG; - bind[4].buffer= (void *)&f_data; - bind[4].buffer_length= 0; - bind[4].error= &bind[4].error_value; + my_bind[4].buffer_type= MYSQL_TYPE_LONG; + my_bind[4].buffer= (void *)&f_data; + my_bind[4].buffer_length= 0; + my_bind[4].error= &my_bind[4].error_value; - bind[5].buffer_type= MYSQL_TYPE_STRING; - bind[5].buffer= (void *)d_data; - bind[5].buffer_length= sizeof(d_data); - bind[5].error= &bind[5].error_value; + my_bind[5].buffer_type= MYSQL_TYPE_STRING; + my_bind[5].buffer= (void *)d_data; + my_bind[5].buffer_length= sizeof(d_data); + my_bind[5].error= &my_bind[5].error_value; - bind[6].buffer_type= MYSQL_TYPE_LONG; - bind[6].buffer= (void *)&bData; - bind[6].buffer_length= 0; - bind[6].error= &bind[6].error_value; + my_bind[6].buffer_type= MYSQL_TYPE_LONG; + my_bind[6].buffer= (void *)&bData; + my_bind[6].buffer_length= 0; + my_bind[6].error= &my_bind[6].error_value; - bind[7].buffer_type= MYSQL_TYPE_DOUBLE; - bind[7].buffer= (void *)&szData; - bind[7].buffer_length= 0; - bind[7].error= &bind[7].error_value; + my_bind[7].buffer_type= MYSQL_TYPE_DOUBLE; + my_bind[7].buffer= (void *)&szData; + my_bind[7].buffer_length= 0; + my_bind[7].error= &my_bind[7].error_value; - for (i= 0; i < array_elements(bind); i++) + for (i= 0; i < array_elements(my_bind); i++) { - bind[i].is_null= &is_null[i]; - bind[i].length= &length[i]; + my_bind[i].is_null= &is_null[i]; + my_bind[i].length= &length[i]; } stmt= mysql_simple_prepare(mysql, "select * from test_bind_result"); check_stmt(stmt); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -3807,7 +3807,7 @@ static void bind_fetch(int row_count) double d_data; char s_data[10]; ulong length[10]; - MYSQL_BIND bind[7]; + MYSQL_BIND my_bind[7]; my_bool is_null[7]; stmt= mysql_simple_prepare(mysql, "INSERT INTO test_bind_fetch VALUES " @@ -3817,20 +3817,20 @@ static void bind_fetch(int row_count) verify_param_count(stmt, 7); /* Always bzero all members of bind parameter */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - for (i= 0; i < (int) array_elements(bind); i++) + for (i= 0; i < (int) array_elements(my_bind); i++) { - bind[i].buffer_type= MYSQL_TYPE_LONG; - bind[i].buffer= (void *) &data[i]; + my_bind[i].buffer_type= MYSQL_TYPE_LONG; + my_bind[i].buffer= (void *) &data[i]; } - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); while (count--) { rc= 10+count; - for (i= 0; i < (int) array_elements(bind); i++) + for (i= 0; i < (int) array_elements(my_bind); i++) { data[i]= rc+i; rc+= 12; @@ -3850,36 +3850,36 @@ static void bind_fetch(int row_count) stmt= mysql_simple_prepare(mysql, "SELECT * FROM test_bind_fetch"); check_stmt(stmt); - for (i= 0; i < (int) array_elements(bind); i++) + for (i= 0; i < (int) array_elements(my_bind); i++) { - bind[i].buffer= (void *) &data[i]; - bind[i].length= &length[i]; - bind[i].is_null= &is_null[i]; + my_bind[i].buffer= (void *) &data[i]; + my_bind[i].length= &length[i]; + my_bind[i].is_null= &is_null[i]; } - bind[0].buffer_type= MYSQL_TYPE_TINY; - bind[0].buffer= (void *)&i8_data; + my_bind[0].buffer_type= MYSQL_TYPE_TINY; + my_bind[0].buffer= (void *)&i8_data; - bind[1].buffer_type= MYSQL_TYPE_SHORT; - bind[1].buffer= (void *)&i16_data; + my_bind[1].buffer_type= MYSQL_TYPE_SHORT; + my_bind[1].buffer= (void *)&i16_data; - bind[2].buffer_type= MYSQL_TYPE_LONG; - bind[2].buffer= (void *)&i32_data; + my_bind[2].buffer_type= MYSQL_TYPE_LONG; + my_bind[2].buffer= (void *)&i32_data; - bind[3].buffer_type= MYSQL_TYPE_LONGLONG; - bind[3].buffer= (void *)&i64_data; + my_bind[3].buffer_type= MYSQL_TYPE_LONGLONG; + my_bind[3].buffer= (void *)&i64_data; - bind[4].buffer_type= MYSQL_TYPE_FLOAT; - bind[4].buffer= (void *)&f_data; + my_bind[4].buffer_type= MYSQL_TYPE_FLOAT; + my_bind[4].buffer= (void *)&f_data; - bind[5].buffer_type= MYSQL_TYPE_DOUBLE; - bind[5].buffer= (void *)&d_data; + my_bind[5].buffer_type= MYSQL_TYPE_DOUBLE; + my_bind[5].buffer= (void *)&d_data; - bind[6].buffer_type= MYSQL_TYPE_STRING; - bind[6].buffer= (void *)&s_data; - bind[6].buffer_length= sizeof(s_data); + my_bind[6].buffer_type= MYSQL_TYPE_STRING; + my_bind[6].buffer= (void *)&s_data; + my_bind[6].buffer_length= sizeof(s_data); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -3958,10 +3958,10 @@ static void test_fetch_date() MYSQL_STMT *stmt; uint i; int rc, year; - char date[25], time[25], ts[25], ts_4[25], ts_6[20], dt[20]; + char date[25], my_time[25], ts[25], ts_4[25], ts_6[20], dt[20]; ulong d_length, t_length, ts_length, ts4_length, ts6_length, dt_length, y_length; - MYSQL_BIND bind[8]; + MYSQL_BIND my_bind[8]; my_bool is_null[8]; ulong length[8]; @@ -3990,46 +3990,46 @@ static void test_fetch_date() rc= mysql_commit(mysql); myquery(rc); - bzero((char*) bind, sizeof(bind)); - for (i= 0; i < array_elements(bind); i++) + bzero((char*) my_bind, sizeof(my_bind)); + for (i= 0; i < array_elements(my_bind); i++) { - bind[i].is_null= &is_null[i]; - bind[i].length= &length[i]; + my_bind[i].is_null= &is_null[i]; + my_bind[i].length= &length[i]; } - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[1]= bind[2]= bind[0]; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[1]= my_bind[2]= my_bind[0]; - bind[0].buffer= (void *)&date; - bind[0].buffer_length= sizeof(date); - bind[0].length= &d_length; + my_bind[0].buffer= (void *)&date; + my_bind[0].buffer_length= sizeof(date); + my_bind[0].length= &d_length; - bind[1].buffer= (void *)&time; - bind[1].buffer_length= sizeof(time); - bind[1].length= &t_length; + my_bind[1].buffer= (void *)&my_time; + my_bind[1].buffer_length= sizeof(my_time); + my_bind[1].length= &t_length; - bind[2].buffer= (void *)&ts; - bind[2].buffer_length= sizeof(ts); - bind[2].length= &ts_length; + my_bind[2].buffer= (void *)&ts; + my_bind[2].buffer_length= sizeof(ts); + my_bind[2].length= &ts_length; - bind[3].buffer_type= MYSQL_TYPE_LONG; - bind[3].buffer= (void *)&year; - bind[3].length= &y_length; + my_bind[3].buffer_type= MYSQL_TYPE_LONG; + my_bind[3].buffer= (void *)&year; + my_bind[3].length= &y_length; - bind[4].buffer_type= MYSQL_TYPE_STRING; - bind[4].buffer= (void *)&dt; - bind[4].buffer_length= sizeof(dt); - bind[4].length= &dt_length; + my_bind[4].buffer_type= MYSQL_TYPE_STRING; + my_bind[4].buffer= (void *)&dt; + my_bind[4].buffer_length= sizeof(dt); + my_bind[4].length= &dt_length; - bind[5].buffer_type= MYSQL_TYPE_STRING; - bind[5].buffer= (void *)&ts_4; - bind[5].buffer_length= sizeof(ts_4); - bind[5].length= &ts4_length; + my_bind[5].buffer_type= MYSQL_TYPE_STRING; + my_bind[5].buffer= (void *)&ts_4; + my_bind[5].buffer_length= sizeof(ts_4); + my_bind[5].length= &ts4_length; - bind[6].buffer_type= MYSQL_TYPE_STRING; - bind[6].buffer= (void *)&ts_6; - bind[6].buffer_length= sizeof(ts_6); - bind[6].length= &ts6_length; + my_bind[6].buffer_type= MYSQL_TYPE_STRING; + my_bind[6].buffer= (void *)&ts_6; + my_bind[6].buffer_length= sizeof(ts_6); + my_bind[6].length= &ts6_length; rc= my_stmt_result("SELECT * FROM test_bind_result"); DIE_UNLESS(rc == 1); @@ -4037,7 +4037,7 @@ static void test_fetch_date() stmt= mysql_simple_prepare(mysql, "SELECT * FROM test_bind_result"); check_stmt(stmt); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -4050,7 +4050,7 @@ static void test_fetch_date() if (!opt_silent) { fprintf(stdout, "\n date : %s(%lu)", date, d_length); - fprintf(stdout, "\n time : %s(%lu)", time, t_length); + fprintf(stdout, "\n time : %s(%lu)", my_time, t_length); fprintf(stdout, "\n ts : %s(%lu)", ts, ts_length); fprintf(stdout, "\n year : %d(%lu)", year, y_length); fprintf(stdout, "\n dt : %s(%lu)", dt, dt_length); @@ -4061,7 +4061,7 @@ static void test_fetch_date() DIE_UNLESS(strcmp(date, "2002-01-02") == 0); DIE_UNLESS(d_length == 10); - DIE_UNLESS(strcmp(time, "12:49:00") == 0); + DIE_UNLESS(strcmp(my_time, "12:49:00") == 0); DIE_UNLESS(t_length == 8); DIE_UNLESS(strcmp(ts, "2002-01-02 17:46:59") == 0); @@ -4266,7 +4266,7 @@ static void test_prepare_ext() char tData= 1; short sData= 10; longlong bData= 20; - MYSQL_BIND bind[6]; + MYSQL_BIND my_bind[6]; char query[MAX_TEST_QUERY_LENGTH]; myheader("test_prepare_ext"); @@ -4319,33 +4319,33 @@ static void test_prepare_ext() verify_param_count(stmt, 6); /* Always bzero all members of bind parameter */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); /*tinyint*/ - bind[0].buffer_type= MYSQL_TYPE_TINY; - bind[0].buffer= (void *)&tData; + my_bind[0].buffer_type= MYSQL_TYPE_TINY; + my_bind[0].buffer= (void *)&tData; /*smallint*/ - bind[1].buffer_type= MYSQL_TYPE_SHORT; - bind[1].buffer= (void *)&sData; + my_bind[1].buffer_type= MYSQL_TYPE_SHORT; + my_bind[1].buffer= (void *)&sData; /*mediumint*/ - bind[2].buffer_type= MYSQL_TYPE_LONG; - bind[2].buffer= (void *)&nData; + my_bind[2].buffer_type= MYSQL_TYPE_LONG; + my_bind[2].buffer= (void *)&nData; /*int*/ - bind[3].buffer_type= MYSQL_TYPE_LONG; - bind[3].buffer= (void *)&nData; + my_bind[3].buffer_type= MYSQL_TYPE_LONG; + my_bind[3].buffer= (void *)&nData; /*integer*/ - bind[4].buffer_type= MYSQL_TYPE_LONG; - bind[4].buffer= (void *)&nData; + my_bind[4].buffer_type= MYSQL_TYPE_LONG; + my_bind[4].buffer= (void *)&nData; /*bigint*/ - bind[5].buffer_type= MYSQL_TYPE_LONGLONG; - bind[5].buffer= (void *)&bData; + my_bind[5].buffer_type= MYSQL_TYPE_LONGLONG; + my_bind[5].buffer= (void *)&bData; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); /* @@ -4484,7 +4484,7 @@ static void test_insert() char str_data[50]; char tiny_data; MYSQL_RES *result; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; ulong length; myheader("test_insert"); @@ -4510,19 +4510,19 @@ static void test_insert() We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); /* tinyint */ - bind[0].buffer_type= MYSQL_TYPE_TINY; - bind[0].buffer= (void *)&tiny_data; + my_bind[0].buffer_type= MYSQL_TYPE_TINY; + my_bind[0].buffer= (void *)&tiny_data; /* string */ - bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= str_data; - bind[1].buffer_length= sizeof(str_data);; - bind[1].length= &length; + my_bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].buffer= str_data; + my_bind[1].buffer_length= sizeof(str_data);; + my_bind[1].length= &length; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); /* now, execute the prepared statement to insert 10 records.. */ @@ -4651,7 +4651,7 @@ static void test_stmt_close() { MYSQL *lmysql; MYSQL_STMT *stmt1, *stmt2, *stmt3, *stmt_x; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; MYSQL_RES *result; unsigned int count; int rc; @@ -4732,13 +4732,13 @@ static void test_stmt_close() We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer= (void *)&count; - bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&count; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; count= 100; - rc= mysql_stmt_bind_param(stmt_x, bind); + rc= mysql_stmt_bind_param(stmt_x, my_bind); check_execute(stmt_x, rc); rc= mysql_stmt_execute(stmt_x); @@ -5166,7 +5166,7 @@ static void test_multi_stmt() int rc; uint32 id; char name[50]; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; ulong length[2]; my_bool is_null[2]; myheader("test_multi_stmt"); @@ -5194,25 +5194,25 @@ static void test_multi_stmt() We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *)&id; - bind[0].is_null= &is_null[0]; - bind[0].length= &length[0]; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&id; + my_bind[0].is_null= &is_null[0]; + my_bind[0].length= &length[0]; is_null[0]= 0; length[0]= 0; - bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (void *)name; - bind[1].buffer_length= sizeof(name); - bind[1].length= &length[1]; - bind[1].is_null= &is_null[1]; + my_bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].buffer= (void *)name; + my_bind[1].buffer_length= sizeof(name); + my_bind[1].length= &length[1]; + my_bind[1].is_null= &is_null[1]; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); id= 10; @@ -5242,7 +5242,7 @@ static void test_multi_stmt() verify_param_count(stmt1, 2); - rc= mysql_stmt_bind_param(stmt1, bind); + rc= mysql_stmt_bind_param(stmt1, my_bind); check_execute(stmt1, rc); rc= mysql_stmt_execute(stmt2); @@ -5300,7 +5300,7 @@ static void test_manual_sample() int rc; char str_data[50]; ulonglong affected_rows; - MYSQL_BIND bind[3]; + MYSQL_BIND my_bind[3]; my_bool is_null; char query[MAX_TEST_QUERY_LENGTH]; @@ -5355,25 +5355,25 @@ static void test_manual_sample() We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); /* INTEGER PART */ - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *)&int_data; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&int_data; /* STRING PART */ - bind[1].buffer_type= MYSQL_TYPE_VAR_STRING; - bind[1].buffer= (void *)str_data; - bind[1].buffer_length= sizeof(str_data); + my_bind[1].buffer_type= MYSQL_TYPE_VAR_STRING; + my_bind[1].buffer= (void *)str_data; + my_bind[1].buffer_length= sizeof(str_data); /* SMALLINT PART */ - bind[2].buffer_type= MYSQL_TYPE_SHORT; - bind[2].buffer= (void *)&small_data; - bind[2].is_null= &is_null; + my_bind[2].buffer_type= MYSQL_TYPE_SHORT; + my_bind[2].buffer= (void *)&small_data; + my_bind[2].is_null= &is_null; is_null= 0; /* Bind the buffers */ - if (mysql_stmt_bind_param(stmt, bind)) + if (mysql_stmt_bind_param(stmt, my_bind)) { fprintf(stderr, "\n param bind failed"); fprintf(stderr, "\n %s", mysql_stmt_error(stmt)); @@ -5459,7 +5459,7 @@ static void test_prepare_alter() { MYSQL_STMT *stmt; int rc, id; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; my_bool is_null; myheader("test_prepare_alter"); @@ -5482,14 +5482,14 @@ static void test_prepare_alter() We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); is_null= 0; - bind[0].buffer_type= MYSQL_TYPE_SHORT; - bind[0].buffer= (void *)&id; - bind[0].is_null= &is_null; + my_bind[0].buffer_type= MYSQL_TYPE_SHORT; + my_bind[0].buffer= (void *)&id; + my_bind[0].is_null= &is_null; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); id= 30; @@ -5689,7 +5689,7 @@ static void test_store_result() int rc; int32 nData; char szData[100]; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; ulong length, length1; my_bool is_null[2]; @@ -5711,24 +5711,24 @@ static void test_store_result() myquery(rc); /* fetch */ - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *) &nData; /* integer data */ - bind[0].length= &length; - bind[0].is_null= &is_null[0]; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *) &nData; /* integer data */ + my_bind[0].length= &length; + my_bind[0].is_null= &is_null[0]; length= 0; - bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= szData; /* string data */ - bind[1].buffer_length= sizeof(szData); - bind[1].length= &length1; - bind[1].is_null= &is_null[1]; + my_bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].buffer= szData; /* string data */ + my_bind[1].buffer_length= sizeof(szData); + my_bind[1].length= &length1; + my_bind[1].is_null= &is_null[1]; length1= 0; stmt= mysql_simple_prepare(mysql, "SELECT * FROM test_store_result"); check_stmt(stmt); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -5874,7 +5874,7 @@ static void test_store_result2() int rc; int nData; ulong length; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; char query[MAX_TEST_QUERY_LENGTH]; myheader("test_store_result2"); @@ -5898,21 +5898,21 @@ static void test_store_result2() We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *) &nData; /* integer data */ - bind[0].length= &length; - bind[0].is_null= 0; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *) &nData; /* integer data */ + my_bind[0].length= &length; + my_bind[0].is_null= 0; strmov((char *)query , "SELECT col1 FROM test_store_result where col1= ?"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); nData= 10; length= 0; @@ -5961,7 +5961,7 @@ static void test_subselect() MYSQL_STMT *stmt; int rc, id; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; DBUG_ENTER("test_subselect"); myheader("test_subselect"); @@ -5992,17 +5992,17 @@ static void test_subselect() We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *) &id; - bind[0].length= 0; - bind[0].is_null= 0; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *) &id; + my_bind[0].length= 0; + my_bind[0].is_null= 0; stmt= mysql_simple_prepare(mysql, "INSERT INTO test_sub2(id) SELECT * FROM test_sub1 WHERE id= ?"); check_stmt(stmt); - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); id= 2; @@ -6033,10 +6033,10 @@ static void test_subselect() "from test_sub2 WHERE id1= ?)")); check_stmt(stmt); - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); id= 7; @@ -6082,7 +6082,7 @@ static void test_bind_date_conv(uint row_count) MYSQL_STMT *stmt= 0; uint rc, i, count= row_count; ulong length[4]; - MYSQL_BIND bind[4]; + MYSQL_BIND my_bind[4]; my_bool is_null[4]= {0}; MYSQL_TIME tm[4]; ulong second_part; @@ -6097,19 +6097,19 @@ static void test_bind_date_conv(uint row_count) We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_TIMESTAMP; - bind[1].buffer_type= MYSQL_TYPE_TIME; - bind[2].buffer_type= MYSQL_TYPE_DATETIME; - bind[3].buffer_type= MYSQL_TYPE_DATE; + my_bind[0].buffer_type= MYSQL_TYPE_TIMESTAMP; + my_bind[1].buffer_type= MYSQL_TYPE_TIME; + my_bind[2].buffer_type= MYSQL_TYPE_DATETIME; + my_bind[3].buffer_type= MYSQL_TYPE_DATE; - for (i= 0; i < (int) array_elements(bind); i++) + for (i= 0; i < (int) array_elements(my_bind); i++) { - bind[i].buffer= (void *) &tm[i]; - bind[i].is_null= &is_null[i]; - bind[i].length= &length[i]; - bind[i].buffer_length= 30; + my_bind[i].buffer= (void *) &tm[i]; + my_bind[i].is_null= &is_null[i]; + my_bind[i].length= &length[i]; + my_bind[i].buffer_length= 30; length[i]= 20; } @@ -6123,16 +6123,16 @@ static void test_bind_date_conv(uint row_count) minute= 16; sec= 20; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); for (count= 0; count < row_count; count++) { - for (i= 0; i < (int) array_elements(bind); i++) + for (i= 0; i < (int) array_elements(my_bind); i++) { tm[i].neg= 0; tm[i].second_part= second_part+count; - if (bind[i].buffer_type != MYSQL_TYPE_TIME) + if (my_bind[i].buffer_type != MYSQL_TYPE_TIME) { tm[i].year= year+count; tm[i].month= month+count; @@ -6140,7 +6140,7 @@ static void test_bind_date_conv(uint row_count) } else tm[i].year= tm[i].month= tm[i].day= 0; - if (bind[i].buffer_type != MYSQL_TYPE_DATE) + if (my_bind[i].buffer_type != MYSQL_TYPE_DATE) { tm[i].hour= hour+count; tm[i].minute= minute+count; @@ -6164,7 +6164,7 @@ static void test_bind_date_conv(uint row_count) stmt= mysql_simple_prepare(mysql, "SELECT * FROM test_date"); check_stmt(stmt); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -6180,7 +6180,7 @@ static void test_bind_date_conv(uint row_count) if (!opt_silent) fprintf(stdout, "\n"); - for (i= 0; i < array_elements(bind); i++) + for (i= 0; i < array_elements(my_bind); i++) { if (!opt_silent) fprintf(stdout, "\ntime[%d]: %02d-%02d-%02d %02d:%02d:%02d.%02lu", @@ -6317,7 +6317,7 @@ static void test_date_dt() static void test_pure_coverage() { MYSQL_STMT *stmt; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; int rc; ulong length; @@ -6354,18 +6354,18 @@ static void test_pure_coverage() We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].length= &length; - bind[0].is_null= 0; - bind[0].buffer_length= 0; + my_bind[0].length= &length; + my_bind[0].is_null= 0; + my_bind[0].buffer_length= 0; - bind[0].buffer_type= MYSQL_TYPE_GEOMETRY; - rc= mysql_stmt_bind_param(stmt, bind); + my_bind[0].buffer_type= MYSQL_TYPE_GEOMETRY; + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute_r(stmt, rc); /* unsupported buffer type */ - bind[0].buffer_type= MYSQL_TYPE_STRING; - rc= mysql_stmt_bind_param(stmt, bind); + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_store_result(stmt); @@ -6379,8 +6379,8 @@ static void test_pure_coverage() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - bind[0].buffer_type= MYSQL_TYPE_GEOMETRY; - rc= mysql_stmt_bind_result(stmt, bind); + my_bind[0].buffer_type= MYSQL_TYPE_GEOMETRY; + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute_r(stmt, rc); /* unsupported buffer type */ rc= mysql_stmt_store_result(stmt); @@ -6400,7 +6400,7 @@ static void test_pure_coverage() static void test_buffers() { MYSQL_STMT *stmt; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; int rc; ulong length; my_bool is_null; @@ -6426,15 +6426,15 @@ static void test_buffers() bzero(buffer, sizeof(buffer)); /* Avoid overruns in printf() */ - bzero((char*) bind, sizeof(bind)); - bind[0].length= &length; - bind[0].is_null= &is_null; - bind[0].buffer_length= 1; - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *)buffer; - bind[0].error= &bind[0].error_value; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].length= &length; + my_bind[0].is_null= &is_null; + my_bind[0].buffer_length= 1; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *)buffer; + my_bind[0].error= &my_bind[0].error_value; - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_store_result(stmt); @@ -6443,15 +6443,15 @@ static void test_buffers() buffer[1]= 'X'; rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == MYSQL_DATA_TRUNCATED); - DIE_UNLESS(bind[0].error_value); + DIE_UNLESS(my_bind[0].error_value); if (!opt_silent) fprintf(stdout, "\n data: %s (%lu)", buffer, length); DIE_UNLESS(buffer[0] == 'M'); DIE_UNLESS(buffer[1] == 'X'); DIE_UNLESS(length == 5); - bind[0].buffer_length= 8; - rc= mysql_stmt_bind_result(stmt, bind);/* re-bind */ + my_bind[0].buffer_length= 8; + rc= mysql_stmt_bind_result(stmt, my_bind);/* re-bind */ check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); @@ -6461,8 +6461,8 @@ static void test_buffers() DIE_UNLESS(strncmp(buffer, "Database", 8) == 0); DIE_UNLESS(length == 8); - bind[0].buffer_length= 12; - rc= mysql_stmt_bind_result(stmt, bind);/* re-bind */ + my_bind[0].buffer_length= 12; + rc= mysql_stmt_bind_result(stmt, my_bind);/* re-bind */ check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); @@ -6472,13 +6472,13 @@ static void test_buffers() DIE_UNLESS(strcmp(buffer, "Open-Source") == 0); DIE_UNLESS(length == 11); - bind[0].buffer_length= 6; - rc= mysql_stmt_bind_result(stmt, bind);/* re-bind */ + my_bind[0].buffer_length= 6; + rc= mysql_stmt_bind_result(stmt, my_bind);/* re-bind */ check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == MYSQL_DATA_TRUNCATED); - DIE_UNLESS(bind[0].error_value); + DIE_UNLESS(my_bind[0].error_value); if (!opt_silent) fprintf(stdout, "\n data: %s (%lu)", buffer, length); DIE_UNLESS(strncmp(buffer, "Popula", 6) == 0); @@ -6594,7 +6594,7 @@ static void test_open_direct() static void test_fetch_nobuffs() { MYSQL_STMT *stmt; - MYSQL_BIND bind[4]; + MYSQL_BIND my_bind[4]; char str[4][50]; int rc; @@ -6615,16 +6615,16 @@ static void test_fetch_nobuffs() fprintf(stdout, "\n total rows : %d", rc); DIE_UNLESS(rc == 1); - bzero((char*) bind, sizeof(MYSQL_BIND)); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *)str[0]; - bind[0].buffer_length= sizeof(str[0]); - bind[1]= bind[2]= bind[3]= bind[0]; - bind[1].buffer= (void *)str[1]; - bind[2].buffer= (void *)str[2]; - bind[3].buffer= (void *)str[3]; + bzero((char*) my_bind, sizeof(MYSQL_BIND)); + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *)str[0]; + my_bind[0].buffer_length= sizeof(str[0]); + my_bind[1]= my_bind[2]= my_bind[3]= my_bind[0]; + my_bind[1].buffer= (void *)str[1]; + my_bind[2].buffer= (void *)str[2]; + my_bind[3].buffer= (void *)str[3]; - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -6655,7 +6655,7 @@ static void test_fetch_nobuffs() static void test_ushort_bug() { MYSQL_STMT *stmt; - MYSQL_BIND bind[4]; + MYSQL_BIND my_bind[4]; ushort short_value; uint32 long_value; ulong s_length, l_length, ll_length, t_length; @@ -6685,26 +6685,26 @@ static void test_ushort_bug() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_SHORT; - bind[0].buffer= (void *)&short_value; - bind[0].is_unsigned= TRUE; - bind[0].length= &s_length; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_SHORT; + my_bind[0].buffer= (void *)&short_value; + my_bind[0].is_unsigned= TRUE; + my_bind[0].length= &s_length; - bind[1].buffer_type= MYSQL_TYPE_LONG; - bind[1].buffer= (void *)&long_value; - bind[1].length= &l_length; + my_bind[1].buffer_type= MYSQL_TYPE_LONG; + my_bind[1].buffer= (void *)&long_value; + my_bind[1].length= &l_length; - bind[2].buffer_type= MYSQL_TYPE_LONGLONG; - bind[2].buffer= (void *)&longlong_value; - bind[2].length= &ll_length; + my_bind[2].buffer_type= MYSQL_TYPE_LONGLONG; + my_bind[2].buffer= (void *)&longlong_value; + my_bind[2].length= &ll_length; - bind[3].buffer_type= MYSQL_TYPE_TINY; - bind[3].buffer= (void *)&tiny_value; - bind[3].is_unsigned= TRUE; - bind[3].length= &t_length; + my_bind[3].buffer_type= MYSQL_TYPE_TINY; + my_bind[3].buffer= (void *)&tiny_value; + my_bind[3].is_unsigned= TRUE; + my_bind[3].length= &t_length; - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); @@ -6743,7 +6743,7 @@ static void test_ushort_bug() static void test_sshort_bug() { MYSQL_STMT *stmt; - MYSQL_BIND bind[4]; + MYSQL_BIND my_bind[4]; short short_value; int32 long_value; ulong s_length, l_length, ll_length, t_length; @@ -6773,25 +6773,25 @@ static void test_sshort_bug() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_SHORT; - bind[0].buffer= (void *)&short_value; - bind[0].length= &s_length; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_SHORT; + my_bind[0].buffer= (void *)&short_value; + my_bind[0].length= &s_length; - bind[1].buffer_type= MYSQL_TYPE_LONG; - bind[1].buffer= (void *)&long_value; - bind[1].length= &l_length; + my_bind[1].buffer_type= MYSQL_TYPE_LONG; + my_bind[1].buffer= (void *)&long_value; + my_bind[1].length= &l_length; - bind[2].buffer_type= MYSQL_TYPE_LONGLONG; - bind[2].buffer= (void *)&longlong_value; - bind[2].length= &ll_length; + my_bind[2].buffer_type= MYSQL_TYPE_LONGLONG; + my_bind[2].buffer= (void *)&longlong_value; + my_bind[2].length= &ll_length; - bind[3].buffer_type= MYSQL_TYPE_TINY; - bind[3].buffer= (void *)&tiny_value; - bind[3].is_unsigned= TRUE; - bind[3].length= &t_length; + my_bind[3].buffer_type= MYSQL_TYPE_TINY; + my_bind[3].buffer= (void *)&tiny_value; + my_bind[3].is_unsigned= TRUE; + my_bind[3].length= &t_length; - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); @@ -6830,7 +6830,7 @@ static void test_sshort_bug() static void test_stiny_bug() { MYSQL_STMT *stmt; - MYSQL_BIND bind[4]; + MYSQL_BIND my_bind[4]; short short_value; int32 long_value; ulong s_length, l_length, ll_length, t_length; @@ -6860,24 +6860,24 @@ static void test_stiny_bug() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_SHORT; - bind[0].buffer= (void *)&short_value; - bind[0].length= &s_length; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_SHORT; + my_bind[0].buffer= (void *)&short_value; + my_bind[0].length= &s_length; - bind[1].buffer_type= MYSQL_TYPE_LONG; - bind[1].buffer= (void *)&long_value; - bind[1].length= &l_length; + my_bind[1].buffer_type= MYSQL_TYPE_LONG; + my_bind[1].buffer= (void *)&long_value; + my_bind[1].length= &l_length; - bind[2].buffer_type= MYSQL_TYPE_LONGLONG; - bind[2].buffer= (void *)&longlong_value; - bind[2].length= &ll_length; + my_bind[2].buffer_type= MYSQL_TYPE_LONGLONG; + my_bind[2].buffer= (void *)&longlong_value; + my_bind[2].length= &ll_length; - bind[3].buffer_type= MYSQL_TYPE_TINY; - bind[3].buffer= (void *)&tiny_value; - bind[3].length= &t_length; + my_bind[3].buffer_type= MYSQL_TYPE_TINY; + my_bind[3].buffer= (void *)&tiny_value; + my_bind[3].length= &t_length; - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); @@ -6917,7 +6917,7 @@ static void test_field_misc() { MYSQL_STMT *stmt; MYSQL_RES *result; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; char table_type[NAME_LEN]; ulong type_length; int rc; @@ -6968,13 +6968,13 @@ static void test_field_misc() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= table_type; - bind[0].length= &type_length; - bind[0].buffer_length= NAME_LEN; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= table_type; + my_bind[0].length= &type_length; + my_bind[0].buffer_length= NAME_LEN; - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); @@ -7256,7 +7256,7 @@ static void test_prepare_grant() static void test_frm_bug() { MYSQL_STMT *stmt; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; MYSQL_RES *result; MYSQL_ROW row; FILE *test_file; @@ -7280,13 +7280,13 @@ static void test_frm_bug() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= data_dir; - bind[0].buffer_length= FN_REFLEN; - bind[1]= bind[0]; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= data_dir; + my_bind[0].buffer_length= FN_REFLEN; + my_bind[1]= my_bind[0]; - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); @@ -7343,7 +7343,7 @@ static void test_frm_bug() static void test_decimal_bug() { MYSQL_STMT *stmt; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; char data[30]; int rc; my_bool is_null; @@ -7368,15 +7368,15 @@ static void test_decimal_bug() We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_NEWDECIMAL; - bind[0].buffer= (void *)data; - bind[0].buffer_length= 25; - bind[0].is_null= &is_null; + my_bind[0].buffer_type= MYSQL_TYPE_NEWDECIMAL; + my_bind[0].buffer= (void *)data; + my_bind[0].buffer_length= 25; + my_bind[0].is_null= &is_null; is_null= 0; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); strmov(data, "8.0"); @@ -7384,7 +7384,7 @@ static void test_decimal_bug() check_execute(stmt, rc); data[0]= 0; - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); @@ -7402,7 +7402,7 @@ static void test_decimal_bug() check_execute(stmt, rc); data[0]= 0; - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); @@ -7427,7 +7427,7 @@ static void test_decimal_bug() check_execute(stmt, rc); data[0]= 0; - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); @@ -7783,7 +7783,7 @@ static void test_cuted_rows() static void test_logs() { MYSQL_STMT *stmt; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; char data[255]; ulong length; int rc; @@ -7806,20 +7806,20 @@ static void test_logs() We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_SHORT; - bind[0].buffer= (void *)&id; + my_bind[0].buffer_type= MYSQL_TYPE_SHORT; + my_bind[0].buffer= (void *)&id; - bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (void *)&data; - bind[1].buffer_length= 255; - bind[1].length= &length; + my_bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].buffer= (void *)&data; + my_bind[1].buffer_length= 255; + my_bind[1].length= &length; id= 9876; length= (ulong)(strmov((char *)data, "MySQL - Open Source Database")- data); - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -7863,14 +7863,14 @@ static void test_logs() stmt= mysql_simple_prepare(mysql, data); check_stmt(stmt); - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - bind[1].buffer_length= 255; - rc= mysql_stmt_bind_result(stmt, bind); + my_bind[1].buffer_length= 255; + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); @@ -7940,7 +7940,7 @@ static void test_nstmts() char query[255]; int rc; static uint i, total_stmts= 2000; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; myheader("test_nstmts"); @@ -7956,10 +7956,10 @@ static void test_nstmts() We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer= (void *)&i; - bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&i; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; for (i= 0; i < total_stmts; i++) { @@ -7970,7 +7970,7 @@ static void test_nstmts() stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -7986,7 +7986,7 @@ static void test_nstmts() check_execute(stmt, rc); i= 0; - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); @@ -8010,7 +8010,7 @@ static void test_nstmts() static void test_fetch_seek() { MYSQL_STMT *stmt; - MYSQL_BIND bind[3]; + MYSQL_BIND my_bind[3]; MYSQL_ROW_OFFSET row; int rc; int32 c1; @@ -8030,22 +8030,22 @@ static void test_fetch_seek() stmt= mysql_simple_prepare(mysql, "select * from t1"); check_stmt(stmt); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *)&c1; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&c1; - bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (void *)c2; - bind[1].buffer_length= sizeof(c2); + my_bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].buffer= (void *)c2; + my_bind[1].buffer_length= sizeof(c2); - bind[2]= bind[1]; - bind[2].buffer= (void *)c3; - bind[2].buffer_length= sizeof(c3); + my_bind[2]= my_bind[1]; + my_bind[2].buffer= (void *)c3; + my_bind[2].buffer_length= sizeof(c3); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_store_result(stmt); @@ -8105,7 +8105,7 @@ static void test_fetch_seek() static void test_fetch_offset() { MYSQL_STMT *stmt; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; char data[11]; ulong length; int rc; @@ -8126,20 +8126,20 @@ static void test_fetch_offset() stmt= mysql_simple_prepare(mysql, "select * from t1"); check_stmt(stmt); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *)data; - bind[0].buffer_length= 11; - bind[0].is_null= &is_null; - bind[0].length= &length; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *)data; + my_bind[0].buffer_length= 11; + my_bind[0].is_null= &is_null; + my_bind[0].length= &length; rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); + rc= mysql_stmt_fetch_column(stmt, my_bind, 0, 0); check_execute_r(stmt, rc); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_store_result(stmt); @@ -8149,19 +8149,19 @@ static void test_fetch_offset() check_execute(stmt, rc); data[0]= '\0'; - rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); + rc= mysql_stmt_fetch_column(stmt, my_bind, 0, 0); check_execute(stmt, rc); if (!opt_silent) fprintf(stdout, "\n col 1: %s (%ld)", data, length); DIE_UNLESS(strncmp(data, "abcd", 4) == 0 && length == 10); - rc= mysql_stmt_fetch_column(stmt, bind, 0, 5); + rc= mysql_stmt_fetch_column(stmt, my_bind, 0, 5); check_execute(stmt, rc); if (!opt_silent) fprintf(stdout, "\n col 1: %s (%ld)", data, length); DIE_UNLESS(strncmp(data, "fg", 2) == 0 && length == 10); - rc= mysql_stmt_fetch_column(stmt, bind, 0, 9); + rc= mysql_stmt_fetch_column(stmt, my_bind, 0, 9); check_execute(stmt, rc); if (!opt_silent) fprintf(stdout, "\n col 0: %s (%ld)", data, length); @@ -8172,7 +8172,7 @@ static void test_fetch_offset() is_null= 0; - rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); + rc= mysql_stmt_fetch_column(stmt, my_bind, 0, 0); check_execute(stmt, rc); DIE_UNLESS(is_null == 1); @@ -8180,7 +8180,7 @@ static void test_fetch_offset() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == MYSQL_NO_DATA); - rc= mysql_stmt_fetch_column(stmt, bind, 1, 0); + rc= mysql_stmt_fetch_column(stmt, my_bind, 1, 0); check_execute_r(stmt, rc); mysql_stmt_close(stmt); @@ -8194,7 +8194,7 @@ static void test_fetch_offset() static void test_fetch_column() { MYSQL_STMT *stmt; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; char c2[20], bc2[20]; ulong l1, l2, bl1, bl2; int rc, c1, bc1; @@ -8213,28 +8213,28 @@ static void test_fetch_column() stmt= mysql_simple_prepare(mysql, "select * from t1 order by c2 desc"); check_stmt(stmt); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *)&bc1; - bind[0].buffer_length= 0; - bind[0].is_null= 0; - bind[0].length= &bl1; - bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (void *)bc2; - bind[1].buffer_length= 7; - bind[1].is_null= 0; - bind[1].length= &bl2; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&bc1; + my_bind[0].buffer_length= 0; + my_bind[0].is_null= 0; + my_bind[0].length= &bl1; + my_bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].buffer= (void *)bc2; + my_bind[1].buffer_length= 7; + my_bind[1].is_null= 0; + my_bind[1].length= &bl2; rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_store_result(stmt); check_execute(stmt, rc); - rc= mysql_stmt_fetch_column(stmt, bind, 1, 0); /* No-op at this point */ + rc= mysql_stmt_fetch_column(stmt, my_bind, 1, 0); /* No-op at this point */ check_execute_r(stmt, rc); rc= mysql_stmt_fetch(stmt); @@ -8244,33 +8244,33 @@ static void test_fetch_column() fprintf(stdout, "\n row 0: %d, %s", bc1, bc2); c2[0]= '\0'; l2= 0; - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *)c2; - bind[0].buffer_length= 7; - bind[0].is_null= 0; - bind[0].length= &l2; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *)c2; + my_bind[0].buffer_length= 7; + my_bind[0].is_null= 0; + my_bind[0].length= &l2; - rc= mysql_stmt_fetch_column(stmt, bind, 1, 0); + rc= mysql_stmt_fetch_column(stmt, my_bind, 1, 0); check_execute(stmt, rc); if (!opt_silent) fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); DIE_UNLESS(strncmp(c2, "venu", 4) == 0 && l2 == 4); c2[0]= '\0'; l2= 0; - rc= mysql_stmt_fetch_column(stmt, bind, 1, 0); + rc= mysql_stmt_fetch_column(stmt, my_bind, 1, 0); check_execute(stmt, rc); if (!opt_silent) fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); DIE_UNLESS(strcmp(c2, "venu") == 0 && l2 == 4); c1= 0; - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *)&c1; - bind[0].buffer_length= 0; - bind[0].is_null= 0; - bind[0].length= &l1; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&c1; + my_bind[0].buffer_length= 0; + my_bind[0].is_null= 0; + my_bind[0].length= &l1; - rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); + rc= mysql_stmt_fetch_column(stmt, my_bind, 0, 0); check_execute(stmt, rc); if (!opt_silent) fprintf(stdout, "\n col 0: %d(%ld)", c1, l1); @@ -8283,33 +8283,33 @@ static void test_fetch_column() fprintf(stdout, "\n row 1: %d, %s", bc1, bc2); c2[0]= '\0'; l2= 0; - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *)c2; - bind[0].buffer_length= 7; - bind[0].is_null= 0; - bind[0].length= &l2; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *)c2; + my_bind[0].buffer_length= 7; + my_bind[0].is_null= 0; + my_bind[0].length= &l2; - rc= mysql_stmt_fetch_column(stmt, bind, 1, 0); + rc= mysql_stmt_fetch_column(stmt, my_bind, 1, 0); check_execute(stmt, rc); if (!opt_silent) fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); DIE_UNLESS(strncmp(c2, "mysq", 4) == 0 && l2 == 5); c2[0]= '\0'; l2= 0; - rc= mysql_stmt_fetch_column(stmt, bind, 1, 0); + rc= mysql_stmt_fetch_column(stmt, my_bind, 1, 0); check_execute(stmt, rc); if (!opt_silent) fprintf(stdout, "\n col 1: %si(%ld)", c2, l2); DIE_UNLESS(strcmp(c2, "mysql") == 0 && l2 == 5); c1= 0; - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *)&c1; - bind[0].buffer_length= 0; - bind[0].is_null= 0; - bind[0].length= &l1; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&c1; + my_bind[0].buffer_length= 0; + my_bind[0].is_null= 0; + my_bind[0].length= &l1; - rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); + rc= mysql_stmt_fetch_column(stmt, my_bind, 0, 0); check_execute(stmt, rc); if (!opt_silent) fprintf(stdout, "\n col 0: %d(%ld)", c1, l1); @@ -8318,7 +8318,7 @@ static void test_fetch_column() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == MYSQL_NO_DATA); - rc= mysql_stmt_fetch_column(stmt, bind, 1, 0); + rc= mysql_stmt_fetch_column(stmt, my_bind, 1, 0); check_execute_r(stmt, rc); mysql_stmt_close(stmt); @@ -8475,7 +8475,7 @@ static void test_mem_overun() static void test_free_result() { MYSQL_STMT *stmt; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; char c2[5]; ulong bl1, l2; int rc, c1, bc1; @@ -8495,28 +8495,28 @@ static void test_free_result() stmt= mysql_simple_prepare(mysql, "select * from test_free_result"); check_stmt(stmt); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *)&bc1; - bind[0].length= &bl1; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&bc1; + my_bind[0].length= &bl1; rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); c2[0]= '\0'; l2= 0; - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *)c2; - bind[0].buffer_length= 7; - bind[0].is_null= 0; - bind[0].length= &l2; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *)c2; + my_bind[0].buffer_length= 7; + my_bind[0].is_null= 0; + my_bind[0].length= &l2; - rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); + rc= mysql_stmt_fetch_column(stmt, my_bind, 0, 0); check_execute(stmt, rc); if (!opt_silent) fprintf(stdout, "\n col 0: %s(%ld)", c2, l2); @@ -8526,13 +8526,13 @@ static void test_free_result() check_execute(stmt, rc); c1= 0, l2= 0; - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *)&c1; - bind[0].buffer_length= 0; - bind[0].is_null= 0; - bind[0].length= &l2; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&c1; + my_bind[0].buffer_length= 0; + my_bind[0].is_null= 0; + my_bind[0].length= &l2; - rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); + rc= mysql_stmt_fetch_column(stmt, my_bind, 0, 0); check_execute(stmt, rc); if (!opt_silent) fprintf(stdout, "\n col 0: %d(%ld)", c1, l2); @@ -8556,7 +8556,7 @@ static void test_free_result() static void test_free_store_result() { MYSQL_STMT *stmt; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; char c2[5]; ulong bl1, l2; int rc, c1, bc1; @@ -8575,17 +8575,17 @@ static void test_free_store_result() stmt= mysql_simple_prepare(mysql, "select * from test_free_result"); check_stmt(stmt); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *)&bc1; - bind[0].buffer_length= 0; - bind[0].is_null= 0; - bind[0].length= &bl1; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&bc1; + my_bind[0].buffer_length= 0; + my_bind[0].is_null= 0; + my_bind[0].length= &bl1; rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_store_result(stmt); @@ -8595,13 +8595,13 @@ static void test_free_store_result() check_execute(stmt, rc); c2[0]= '\0'; l2= 0; - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *)c2; - bind[0].buffer_length= 7; - bind[0].is_null= 0; - bind[0].length= &l2; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *)c2; + my_bind[0].buffer_length= 7; + my_bind[0].is_null= 0; + my_bind[0].length= &l2; - rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); + rc= mysql_stmt_fetch_column(stmt, my_bind, 0, 0); check_execute(stmt, rc); if (!opt_silent) fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); @@ -8611,13 +8611,13 @@ static void test_free_store_result() check_execute(stmt, rc); c1= 0, l2= 0; - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *)&c1; - bind[0].buffer_length= 0; - bind[0].is_null= 0; - bind[0].length= &l2; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&c1; + my_bind[0].buffer_length= 0; + my_bind[0].is_null= 0; + my_bind[0].length= &l2; - rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); + rc= mysql_stmt_fetch_column(stmt, my_bind, 0, 0); check_execute(stmt, rc); if (!opt_silent) fprintf(stdout, "\n col 0: %d(%ld)", c1, l2); @@ -8638,7 +8638,7 @@ static void test_free_store_result() static void test_sqlmode() { MYSQL_STMT *stmt; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; char c1[5], c2[5]; int rc; char query[MAX_TEST_QUERY_LENGTH]; @@ -8671,17 +8671,17 @@ static void test_sqlmode() We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *)c1; - bind[0].buffer_length= 2; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *)c1; + my_bind[0].buffer_length= 2; - bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (void *)c2; - bind[1].buffer_length= 3; + my_bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].buffer= (void *)c2; + my_bind[1].buffer_length= 3; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); strmov(c1, "My"); strmov(c2, "SQL"); @@ -8715,7 +8715,7 @@ static void test_sqlmode() if (!opt_silent) fprintf(stdout, "\n total parameters: %ld", mysql_stmt_param_count(stmt)); - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); strmov(c1, "My"); strmov(c2, "SQL"); @@ -8778,7 +8778,7 @@ static void test_sqlmode() static void test_ts() { MYSQL_STMT *stmt; - MYSQL_BIND bind[6]; + MYSQL_BIND my_bind[6]; MYSQL_TIME ts; MYSQL_RES *prep_res; char strts[30]; @@ -8811,22 +8811,22 @@ static void test_ts() We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_TIMESTAMP; - bind[0].buffer= (void *)&ts; - bind[0].buffer_length= sizeof(ts); + my_bind[0].buffer_type= MYSQL_TYPE_TIMESTAMP; + my_bind[0].buffer= (void *)&ts; + my_bind[0].buffer_length= sizeof(ts); - bind[2]= bind[1]= bind[0]; + my_bind[2]= my_bind[1]= my_bind[0]; - bind[3].buffer_type= MYSQL_TYPE_STRING; - bind[3].buffer= (void *)strts; - bind[3].buffer_length= sizeof(strts); - bind[3].length= &length; + my_bind[3].buffer_type= MYSQL_TYPE_STRING; + my_bind[3].buffer= (void *)strts; + my_bind[3].buffer_length= sizeof(strts); + my_bind[3].length= &length; - bind[5]= bind[4]= bind[3]; + my_bind[5]= my_bind[4]= my_bind[3]; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -8865,7 +8865,7 @@ static void test_ts() stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -8887,7 +8887,7 @@ static void test_ts() static void test_bug1500() { MYSQL_STMT *stmt; - MYSQL_BIND bind[3]; + MYSQL_BIND my_bind[3]; int rc; int32 int_data[3]= {2, 3, 4}; const char *data; @@ -8914,15 +8914,15 @@ static void test_bug1500() We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer= (void *)int_data; - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[2]= bind[1]= bind[0]; - bind[1].buffer= (void *)(int_data + 1); - bind[2].buffer= (void *)(int_data + 2); + my_bind[0].buffer= (void *)int_data; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[2]= my_bind[1]= my_bind[0]; + my_bind[1].buffer= (void *)(int_data + 1); + my_bind[2].buffer= (void *)(int_data + 2); - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -8953,13 +8953,13 @@ static void test_bug1500() verify_param_count(stmt, 1); data= "Dogs"; - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *) data; - bind[0].buffer_length= strlen(data); - bind[0].is_null= 0; - bind[0].length= 0; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *) data; + my_bind[0].buffer_length= strlen(data); + my_bind[0].is_null= 0; + my_bind[0].length= 0; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -8978,11 +8978,11 @@ static void test_bug1500() verify_param_count(stmt, 1); data= "Grave"; - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *) data; - bind[0].buffer_length= strlen(data); + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *) data; + my_bind[0].buffer_length= strlen(data); - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -9061,7 +9061,7 @@ static void test_bug2247() int i; const char *create= "CREATE TABLE bug2247(id INT UNIQUE AUTO_INCREMENT)"; const char *insert= "INSERT INTO bug2247 VALUES (NULL)"; - const char *select= "SELECT id FROM bug2247"; + const char *SELECT= "SELECT id FROM bug2247"; const char *update= "UPDATE bug2247 SET id=id+10"; const char *drop= "DROP TABLE IF EXISTS bug2247"; ulonglong exp_count; @@ -9089,7 +9089,7 @@ static void test_bug2247() exp_count= mysql_stmt_affected_rows(stmt); DIE_UNLESS(exp_count == 1); - rc= mysql_query(mysql, select); + rc= mysql_query(mysql, SELECT); myquery(rc); /* mysql_store_result overwrites mysql->affected_rows. Check that @@ -9111,7 +9111,7 @@ static void test_bug2247() mysql_stmt_close(stmt); /* check that mysql_stmt_store_result modifies mysql_stmt_affected_rows */ - stmt= mysql_simple_prepare(mysql, select); + stmt= mysql_simple_prepare(mysql, SELECT); check_stmt(stmt); rc= mysql_stmt_execute(stmt); @@ -9700,7 +9700,7 @@ static void test_multi() { MYSQL_STMT *stmt_delete, *stmt_update, *stmt_select1, *stmt_select2; char *query; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; int rc, i; int32 param= 1; ulong length= 1; @@ -9710,11 +9710,11 @@ static void test_multi() We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *)¶m; - bind[0].length= &length; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)¶m; + my_bind[0].length= &length; rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1, t2"); myquery(rc); @@ -9749,7 +9749,7 @@ static void test_multi() for(i= 0; i < 3; i++) { - rc= mysql_stmt_bind_param(stmt_update, bind); + rc= mysql_stmt_bind_param(stmt_update, my_bind); check_execute(stmt_update, rc); rc= mysql_stmt_execute(stmt_update); @@ -9837,7 +9837,7 @@ static void test_bind_nagative() MYSQL_STMT *stmt_insert; char *query; int rc; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; int32 my_val= 0; ulong my_length= 0L; my_bool my_null= FALSE; @@ -9857,14 +9857,14 @@ static void test_bind_nagative() check_stmt(stmt_insert); /* bind parameters */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *)&my_val; - bind[0].length= &my_length; - bind[0].is_null= (char*)&my_null; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&my_val; + my_bind[0].length= &my_length; + my_bind[0].is_null= (char*)&my_null; - rc= mysql_stmt_bind_param(stmt_insert, bind); + rc= mysql_stmt_bind_param(stmt_insert, my_bind); check_execute(stmt_insert, rc); my_val= -1; @@ -9881,7 +9881,7 @@ static void test_derived() { MYSQL_STMT *stmt; int rc, i; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; int32 my_val= 0; ulong my_length= 0L; my_bool my_null= FALSE; @@ -9906,14 +9906,14 @@ TYPE=InnoDB DEFAULT CHARSET=utf8"); We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *)&my_val; - bind[0].length= &my_length; - bind[0].is_null= (char*)&my_null; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *)&my_val; + my_bind[0].length= &my_length; + my_bind[0].is_null= (char*)&my_null; my_val= 1; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); for (i= 0; i < 3; i++) @@ -9987,7 +9987,7 @@ static void test_bug3035() { MYSQL_STMT *stmt; int rc; - MYSQL_BIND bind_array[12], *bind= bind_array, *bind_end= bind + 12; + MYSQL_BIND bind_array[12], *my_bind= bind_array, *bind_end= my_bind + 12; int8 int8_val; uint8 uint8_val; int16 int16_val; @@ -10040,8 +10040,8 @@ static void test_bug3035() bzero((char*) bind_array, sizeof(bind_array)); - for (bind= bind_array; bind < bind_end; bind++) - bind->error= &bind->error_value; + for (my_bind= bind_array; my_bind < bind_end; my_bind++) + my_bind->error= &my_bind->error_value; bind_array[0].buffer_type= MYSQL_TYPE_TINY; bind_array[0].buffer= (void *) &int8_val; @@ -10153,8 +10153,8 @@ static void test_bug3035() if (!opt_silent) { printf("Truncation mask: "); - for (bind= bind_array; bind < bind_end; bind++) - printf("%d", (int) bind->error_value); + for (my_bind= bind_array; my_bind < bind_end; my_bind++) + printf("%d", (int) my_bind->error_value); printf("\n"); } DIE_UNLESS(rc == MYSQL_DATA_TRUNCATED || rc == 0); @@ -10229,7 +10229,7 @@ static void test_bug1664() int rc, int_data; const char *data; const char *str_data= "Simple string"; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; const char *query= "INSERT INTO test_long_data(col2, col1) VALUES(?, ?)"; myheader("test_bug1664"); @@ -10247,16 +10247,16 @@ static void test_bug1664() verify_param_count(stmt, 2); - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *)str_data; - bind[0].buffer_length= strlen(str_data); + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *)str_data; + my_bind[0].buffer_length= strlen(str_data); - bind[1].buffer= (void *)&int_data; - bind[1].buffer_type= MYSQL_TYPE_LONG; + my_bind[1].buffer= (void *)&int_data; + my_bind[1].buffer_type= MYSQL_TYPE_LONG; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); int_data= 1; @@ -10337,7 +10337,7 @@ static void test_bug1664() check_stmt(stmt); rc= mysql_stmt_prepare(stmt, query, strlen(query)); check_execute(stmt, rc); - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); data= (char *)"SomeData"; @@ -10405,7 +10405,7 @@ static void test_union_param() MYSQL_STMT *stmt; char *query; int rc, i; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; char my_val[4]; ulong my_length= 3L; my_bool my_null= FALSE; @@ -10421,21 +10421,21 @@ static void test_union_param() We need to bzero bind structure because mysql_stmt_bind_param checks all its members. */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); /* bind parameters */ - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char*) &my_val; - bind[0].buffer_length= 4; - bind[0].length= &my_length; - bind[0].is_null= (char*)&my_null; - bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (char*) &my_val; - bind[1].buffer_length= 4; - bind[1].length= &my_length; - bind[1].is_null= (char*)&my_null; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (char*) &my_val; + my_bind[0].buffer_length= 4; + my_bind[0].length= &my_length; + my_bind[0].is_null= (char*)&my_null; + my_bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].buffer= (char*) &my_val; + my_bind[1].buffer_length= 4; + my_bind[1].length= &my_length; + my_bind[1].is_null= (char*)&my_null; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); for (i= 0; i < 3; i++) @@ -10640,7 +10640,7 @@ static void test_ps_i18n() static void test_bug3796() { MYSQL_STMT *stmt; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; const char *concat_arg0= "concat_with_"; enum { OUT_BUFF_SIZE= 30 }; char out_buff[OUT_BUFF_SIZE]; @@ -10672,23 +10672,23 @@ static void test_bug3796() check_execute(stmt, rc); /* Bind input buffers */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void *) concat_arg0; - bind[0].buffer_length= strlen(concat_arg0); + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void *) concat_arg0; + my_bind[0].buffer_length= strlen(concat_arg0); - mysql_stmt_bind_param(stmt, bind); + mysql_stmt_bind_param(stmt, my_bind); /* Execute the select statement */ rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - bind[0].buffer= (void *) out_buff; - bind[0].buffer_length= OUT_BUFF_SIZE; - bind[0].length= &out_length; + my_bind[0].buffer= (void *) out_buff; + my_bind[0].buffer_length= OUT_BUFF_SIZE; + my_bind[0].length= &out_length; - mysql_stmt_bind_result(stmt, bind); + mysql_stmt_bind_result(stmt, my_bind); rc= mysql_stmt_fetch(stmt); if (!opt_silent) @@ -10721,7 +10721,7 @@ static void test_bug3796() static void test_bug4026() { MYSQL_STMT *stmt; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; MYSQL_TIME time_in, time_out; MYSQL_TIME datetime_in, datetime_out; const char *stmt_text; @@ -10739,16 +10739,16 @@ static void test_bug4026() check_execute(stmt, rc); /* Bind input buffers */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); bzero((char*) &time_in, sizeof(time_in)); bzero((char*) &time_out, sizeof(time_out)); bzero((char*) &datetime_in, sizeof(datetime_in)); bzero((char*) &datetime_out, sizeof(datetime_out)); - bind[0].buffer_type= MYSQL_TYPE_TIME; - bind[0].buffer= (void *) &time_in; - bind[1].buffer_type= MYSQL_TYPE_DATETIME; - bind[1].buffer= (void *) &datetime_in; + my_bind[0].buffer_type= MYSQL_TYPE_TIME; + my_bind[0].buffer= (void *) &time_in; + my_bind[1].buffer_type= MYSQL_TYPE_DATETIME; + my_bind[1].buffer= (void *) &datetime_in; time_in.hour= 23; time_in.minute= 59; @@ -10766,16 +10766,16 @@ static void test_bug4026() datetime_in.day= 31; datetime_in.time_type= MYSQL_TIMESTAMP_DATETIME; - mysql_stmt_bind_param(stmt, bind); + mysql_stmt_bind_param(stmt, my_bind); /* Execute the select statement */ rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - bind[0].buffer= (void *) &time_out; - bind[1].buffer= (void *) &datetime_out; + my_bind[0].buffer= (void *) &time_out; + my_bind[1].buffer= (void *) &datetime_out; - mysql_stmt_bind_result(stmt, bind); + mysql_stmt_bind_result(stmt, my_bind); rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == 0); @@ -10797,7 +10797,7 @@ static void test_bug4026() static void test_bug4079() { MYSQL_STMT *stmt; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; const char *stmt_text; uint32 res; int rc; @@ -10821,12 +10821,12 @@ static void test_bug4079() check_execute(stmt, rc); /* Bind input buffers */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void *) &res; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void *) &res; - mysql_stmt_bind_result(stmt, bind); + mysql_stmt_bind_result(stmt, my_bind); rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc != 0 && rc != MYSQL_NO_DATA); @@ -10869,7 +10869,7 @@ static void test_bug4236() static void test_bug4030() { MYSQL_STMT *stmt; - MYSQL_BIND bind[3]; + MYSQL_BIND my_bind[3]; MYSQL_TIME time_canonical, time_out; MYSQL_TIME date_canonical, date_out; MYSQL_TIME datetime_canonical, datetime_out; @@ -10890,7 +10890,7 @@ static void test_bug4030() check_execute(stmt, rc); /* Bind output buffers */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); bzero((char*) &time_canonical, sizeof(time_canonical)); bzero((char*) &time_out, sizeof(time_out)); bzero((char*) &date_canonical, sizeof(date_canonical)); @@ -10898,12 +10898,12 @@ static void test_bug4030() bzero((char*) &datetime_canonical, sizeof(datetime_canonical)); bzero((char*) &datetime_out, sizeof(datetime_out)); - bind[0].buffer_type= MYSQL_TYPE_TIME; - bind[0].buffer= (void *) &time_out; - bind[1].buffer_type= MYSQL_TYPE_DATE; - bind[1].buffer= (void *) &date_out; - bind[2].buffer_type= MYSQL_TYPE_DATETIME; - bind[2].buffer= (void *) &datetime_out; + my_bind[0].buffer_type= MYSQL_TYPE_TIME; + my_bind[0].buffer= (void *) &time_out; + my_bind[1].buffer_type= MYSQL_TYPE_DATE; + my_bind[1].buffer= (void *) &date_out; + my_bind[2].buffer_type= MYSQL_TYPE_DATETIME; + my_bind[2].buffer= (void *) &datetime_out; time_canonical.hour= 23; time_canonical.minute= 59; @@ -10922,7 +10922,7 @@ static void test_bug4030() datetime_canonical.day= 31; datetime_canonical.time_type= MYSQL_TIMESTAMP_DATETIME; - mysql_stmt_bind_result(stmt, bind); + mysql_stmt_bind_result(stmt, my_bind); rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == 0); @@ -10946,7 +10946,7 @@ static void test_view() { MYSQL_STMT *stmt; int rc, i; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; char str_data[50]; ulong length = 0L; long is_null = 0L; @@ -10999,14 +10999,14 @@ static void test_view() check_execute(stmt, rc); strmov(str_data, "TEST"); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= FIELD_TYPE_STRING; - bind[0].buffer= (char *)&str_data; - bind[0].buffer_length= 50; - bind[0].length= &length; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= FIELD_TYPE_STRING; + my_bind[0].buffer= (char *)&str_data; + my_bind[0].buffer_length= 50; + my_bind[0].length= &length; length= 4; - bind[0].is_null= (char*)&is_null; - rc= mysql_stmt_bind_param(stmt, bind); + my_bind[0].is_null= (char*)&is_null; + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt,rc); for (i= 0; i < 3; i++) @@ -11072,7 +11072,7 @@ static void test_view_2where() { MYSQL_STMT *stmt; int rc, i; - MYSQL_BIND bind[8]; + MYSQL_BIND my_bind[8]; char parms[8][100]; ulong length[8]; const char *query= @@ -11120,21 +11120,21 @@ static void test_view_2where() " AENAME,T0001.DEPENDVARS AS DEPENDVARS,T0001.INACTIVE AS " " INACTIVE from LTDX T0001 where (T0001.SRTF2 = 0)"); myquery(rc); - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); for (i=0; i < 8; i++) { strmov(parms[i], "1"); - bind[i].buffer_type = MYSQL_TYPE_VAR_STRING; - bind[i].buffer = (char *)&parms[i]; - bind[i].buffer_length = 100; - bind[i].is_null = 0; - bind[i].length = &length[i]; + my_bind[i].buffer_type = MYSQL_TYPE_VAR_STRING; + my_bind[i].buffer = (char *)&parms[i]; + my_bind[i].buffer_length = 100; + my_bind[i].is_null = 0; + my_bind[i].length = &length[i]; length[i] = 1; } stmt= mysql_stmt_init(mysql); rc= mysql_stmt_prepare(stmt, query, strlen(query)); check_execute(stmt, rc); - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt,rc); rc= mysql_stmt_execute(stmt); @@ -11155,7 +11155,7 @@ static void test_view_star() { MYSQL_STMT *stmt; int rc, i; - MYSQL_BIND bind[8]; + MYSQL_BIND my_bind[8]; char parms[8][100]; ulong length[8]; const char *query= "SELECT * FROM vt1 WHERE a IN (?,?)"; @@ -11170,14 +11170,14 @@ static void test_view_star() myquery(rc); rc= mysql_query(mysql, "CREATE VIEW vt1 AS SELECT a FROM t1"); myquery(rc); - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); for (i= 0; i < 2; i++) { sprintf((char *)&parms[i], "%d", i); - bind[i].buffer_type = MYSQL_TYPE_VAR_STRING; - bind[i].buffer = (char *)&parms[i]; - bind[i].buffer_length = 100; - bind[i].is_null = 0; - bind[i].length = &length[i]; + my_bind[i].buffer_type = MYSQL_TYPE_VAR_STRING; + my_bind[i].buffer = (char *)&parms[i]; + my_bind[i].buffer_length = 100; + my_bind[i].is_null = 0; + my_bind[i].length = &length[i]; length[i] = 1; } @@ -11185,7 +11185,7 @@ static void test_view_star() rc= mysql_stmt_prepare(stmt, query, strlen(query)); check_execute(stmt, rc); - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt,rc); for (i= 0; i < 3; i++) @@ -11209,7 +11209,7 @@ static void test_view_insert() { MYSQL_STMT *insert_stmt, *select_stmt; int rc, i; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; int my_val = 0; ulong my_length = 0L; long my_null = 0L; @@ -11237,12 +11237,12 @@ static void test_view_insert() rc= mysql_stmt_prepare(select_stmt, query, strlen(query)); check_execute(select_stmt, rc); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type = FIELD_TYPE_LONG; - bind[0].buffer = (char *)&my_val; - bind[0].length = &my_length; - bind[0].is_null = (char*)&my_null; - rc= mysql_stmt_bind_param(insert_stmt, bind); + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type = FIELD_TYPE_LONG; + my_bind[0].buffer = (char *)&my_val; + my_bind[0].length = &my_length; + my_bind[0].is_null = (char*)&my_null; + rc= mysql_stmt_bind_param(insert_stmt, my_bind); check_execute(insert_stmt, rc); for (i= 0; i < 3; i++) @@ -11314,7 +11314,7 @@ static void test_view_insert_fields() char parm[11][1000]; ulong l[11]; int rc, i; - MYSQL_BIND bind[11]; + MYSQL_BIND my_bind[11]; const char *query= "INSERT INTO `v1` ( `K1C4` ,`K2C4` ,`K3C4` ,`K4N4` ,`F1C4` ,`F2I4` ,`F3N5` ,`F7F8` ,`F6N4` ,`F5C8` ,`F9D8` ) VALUES( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )"; myheader("test_view_insert_fields"); @@ -11344,22 +11344,22 @@ static void test_view_insert_fields() " F7F8 AS F7F8, F6N4 AS F6N4, F5C8 AS F5C8, F9D8 AS F9D8" " from t1 T0001"); - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); for (i= 0; i < 11; i++) { l[i]= 20; - bind[i].buffer_type= MYSQL_TYPE_STRING; - bind[i].is_null= 0; - bind[i].buffer= (char *)&parm[i]; + my_bind[i].buffer_type= MYSQL_TYPE_STRING; + my_bind[i].is_null= 0; + my_bind[i].buffer= (char *)&parm[i]; strmov(parm[i], "1"); - bind[i].buffer_length= 2; - bind[i].length= &l[i]; + my_bind[i].buffer_length= 2; + my_bind[i].length= &l[i]; } stmt= mysql_stmt_init(mysql); rc= mysql_stmt_prepare(stmt, query, strlen(query)); check_execute(stmt, rc); - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -11386,7 +11386,7 @@ static void test_view_insert_fields() static void test_bug5126() { MYSQL_STMT *stmt; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; int32 c1, c2; const char *stmt_text; int rc; @@ -11413,14 +11413,14 @@ static void test_bug5126() check_execute(stmt, rc); /* Bind output buffers */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= &c1; - bind[1].buffer_type= MYSQL_TYPE_LONG; - bind[1].buffer= &c2; + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= &c1; + my_bind[1].buffer_type= MYSQL_TYPE_LONG; + my_bind[1].buffer= &c2; - mysql_stmt_bind_result(stmt, bind); + mysql_stmt_bind_result(stmt, my_bind); rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == 0); @@ -11434,7 +11434,7 @@ static void test_bug5126() static void test_bug4231() { MYSQL_STMT *stmt; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; MYSQL_TIME tm[2]; const char *stmt_text; int rc; @@ -11459,15 +11459,15 @@ static void test_bug4231() check_execute(stmt, rc); /* Bind input buffers */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); bzero((char*) tm, sizeof(tm)); - bind[0].buffer_type= MYSQL_TYPE_DATE; - bind[0].buffer= &tm[0]; - bind[1].buffer_type= MYSQL_TYPE_DATE; - bind[1].buffer= &tm[1]; + my_bind[0].buffer_type= MYSQL_TYPE_DATE; + my_bind[0].buffer= &tm[0]; + my_bind[1].buffer_type= MYSQL_TYPE_DATE; + my_bind[1].buffer= &tm[1]; - mysql_stmt_bind_param(stmt, bind); + mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); /* @@ -11513,16 +11513,16 @@ static void test_bug5399() #define NUM_OF_USED_STMT 97 MYSQL_STMT *stmt_list[NUM_OF_USED_STMT]; MYSQL_STMT **stmt; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; char buff[600]; int rc; int32 no; myheader("test_bug5399"); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= &no; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= &no; for (stmt= stmt_list; stmt != stmt_list + NUM_OF_USED_STMT; ++stmt) { @@ -11530,7 +11530,7 @@ static void test_bug5399() *stmt= mysql_stmt_init(mysql); rc= mysql_stmt_prepare(*stmt, buff, strlen(buff)); check_execute(*stmt, rc); - mysql_stmt_bind_result(*stmt, bind); + mysql_stmt_bind_result(*stmt, my_bind); } if (!opt_silent) printf("%d statements prepared.\n", NUM_OF_USED_STMT); @@ -11555,7 +11555,7 @@ static void test_bug5399() static void test_bug5194() { MYSQL_STMT *stmt; - MYSQL_BIND *bind; + MYSQL_BIND *my_bind; char *query; char *param_str; int param_str_length; @@ -11653,7 +11653,7 @@ static void test_bug5194() rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); myquery(rc); - bind= (MYSQL_BIND*) malloc(MAX_PARAM_COUNT * sizeof(MYSQL_BIND)); + my_bind= (MYSQL_BIND*) malloc(MAX_PARAM_COUNT * sizeof(MYSQL_BIND)); query= (char*) malloc(strlen(query_template) + MAX_PARAM_COUNT * CHARS_PER_PARAM + 1); param_str= (char*) malloc(COLUMN_COUNT * CHARS_PER_PARAM); @@ -11661,8 +11661,8 @@ static void test_bug5194() if (bind == 0 || query == 0 || param_str == 0) { fprintf(stderr, "Can't allocate enough memory for query structs\n"); - if (bind) - free(bind); + if (my_bind) + free(my_bind); if (query) free(query); if (param_str) @@ -11680,11 +11680,11 @@ static void test_bug5194() param_str_length= strlen(param_str); /* setup bind array */ - bzero((char*) bind, MAX_PARAM_COUNT * sizeof(MYSQL_BIND)); + bzero((char*) my_bind, MAX_PARAM_COUNT * sizeof(MYSQL_BIND)); for (i= 0; i < MAX_PARAM_COUNT; ++i) { - bind[i].buffer_type= MYSQL_TYPE_FLOAT; - bind[i].buffer= fa_ptr; + my_bind[i].buffer_type= MYSQL_TYPE_FLOAT; + my_bind[i].buffer= fa_ptr; if (++fa_ptr == float_array + COLUMN_COUNT) fa_ptr= float_array; } @@ -11724,7 +11724,7 @@ static void test_bug5194() (int) strlen(query), nrows, mysql_stmt_param_count(stmt)); /* bind the parameter array and execute the query */ - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -11732,7 +11732,7 @@ static void test_bug5194() } mysql_stmt_close(stmt); - free(bind); + free(my_bind); free(query); free(param_str); stmt_text= "drop table t1"; @@ -11775,7 +11775,7 @@ static void test_bug5315() static void test_bug6049() { MYSQL_STMT *stmt; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; MYSQL_RES *res; MYSQL_ROW row; const char *stmt_text; @@ -11798,13 +11798,13 @@ static void test_bug6049() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type = MYSQL_TYPE_STRING; - bind[0].buffer = &buffer; - bind[0].buffer_length = sizeof(buffer); - bind[0].length = &length; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type = MYSQL_TYPE_STRING; + my_bind[0].buffer = &buffer; + my_bind[0].buffer_length = sizeof(buffer); + my_bind[0].length = &length; - mysql_stmt_bind_result(stmt, bind); + mysql_stmt_bind_result(stmt, my_bind); rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == 0); @@ -11824,7 +11824,7 @@ static void test_bug6049() static void test_bug6058() { MYSQL_STMT *stmt; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; MYSQL_RES *res; MYSQL_ROW row; const char *stmt_text; @@ -11847,13 +11847,13 @@ static void test_bug6058() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type = MYSQL_TYPE_STRING; - bind[0].buffer = &buffer; - bind[0].buffer_length = sizeof(buffer); - bind[0].length = &length; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type = MYSQL_TYPE_STRING; + my_bind[0].buffer = &buffer; + my_bind[0].buffer_length = sizeof(buffer); + my_bind[0].length = &length; - mysql_stmt_bind_result(stmt, bind); + mysql_stmt_bind_result(stmt, my_bind); rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == 0); @@ -11892,7 +11892,7 @@ static void test_bug6046() const char *stmt_text; int rc; short b= 1; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; myheader("test_bug6046"); @@ -11915,11 +11915,11 @@ static void test_bug6046() check_execute(stmt, rc); b= 1; - bzero((char*) bind, sizeof(bind)); - bind[0].buffer= &b; - bind[0].buffer_type= MYSQL_TYPE_SHORT; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer= &b; + my_bind[0].buffer_type= MYSQL_TYPE_SHORT; - mysql_stmt_bind_param(stmt, bind); + mysql_stmt_bind_param(stmt, my_bind); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); @@ -12037,7 +12037,7 @@ static void test_bug6096() MYSQL_STMT *stmt; MYSQL_RES *query_result, *stmt_metadata; const char *stmt_text; - MYSQL_BIND bind[12]; + MYSQL_BIND my_bind[12]; MYSQL_FIELD *query_field_list, *stmt_field_list; ulong query_field_count, stmt_field_count; int rc; @@ -12110,14 +12110,14 @@ static void test_bug6096() /* Bind and fetch the data */ - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); for (i= 0; i < stmt_field_count; ++i) { - bind[i].buffer_type= MYSQL_TYPE_STRING; - bind[i].buffer_length= stmt_field_list[i].max_length + 1; - bind[i].buffer= malloc(bind[i].buffer_length); + my_bind[i].buffer_type= MYSQL_TYPE_STRING; + my_bind[i].buffer_length= stmt_field_list[i].max_length + 1; + my_bind[i].buffer= malloc(my_bind[i].buffer_length); } - mysql_stmt_bind_result(stmt, bind); + mysql_stmt_bind_result(stmt, my_bind); rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); @@ -12126,7 +12126,7 @@ static void test_bug6096() /* Clean up */ for (i= 0; i < stmt_field_count; ++i) - free(bind[i].buffer); + free(my_bind[i].buffer); mysql_stmt_close(stmt); mysql_free_result(query_result); mysql_free_result(stmt_metadata); @@ -12146,7 +12146,7 @@ static void test_datetime_ranges() const char *stmt_text; int rc, i; MYSQL_STMT *stmt; - MYSQL_BIND bind[6]; + MYSQL_BIND my_bind[6]; MYSQL_TIME tm[6]; myheader("test_datetime_ranges"); @@ -12165,13 +12165,13 @@ static void test_datetime_ranges() check_stmt(stmt); verify_param_count(stmt, 6); - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); for (i= 0; i < 6; i++) { - bind[i].buffer_type= MYSQL_TYPE_DATETIME; - bind[i].buffer= &tm[i]; + my_bind[i].buffer_type= MYSQL_TYPE_DATETIME; + my_bind[i].buffer= &tm[i]; } - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); tm[0].year= 2004; tm[0].month= 11; tm[0].day= 10; @@ -12208,9 +12208,9 @@ static void test_datetime_ranges() We reuse contents of bind and tm arrays left from previous part of test. */ for (i= 0; i < 3; i++) - bind[i].buffer_type= MYSQL_TYPE_DATE; + my_bind[i].buffer_type= MYSQL_TYPE_DATE; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); @@ -12240,9 +12240,9 @@ static void test_datetime_ranges() Again we reuse what we can from previous part of test. */ for (i= 0; i < 5; i++) - bind[i].buffer_type= MYSQL_TYPE_TIME; + my_bind[i].buffer_type= MYSQL_TYPE_TIME; - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); tm[0].year= 0; tm[0].month= 0; tm[0].day= 10; @@ -12273,7 +12273,7 @@ static void test_datetime_ranges() static void test_bug4172() { MYSQL_STMT *stmt; - MYSQL_BIND bind[3]; + MYSQL_BIND my_bind[3]; const char *stmt_text; MYSQL_RES *res; MYSQL_ROW row; @@ -12296,21 +12296,21 @@ static void test_bug4172() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= f; - bind[0].buffer_length= sizeof(f); - bind[0].length= &f_len; - bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= d; - bind[1].buffer_length= sizeof(d); - bind[1].length= &d_len; - bind[2].buffer_type= MYSQL_TYPE_STRING; - bind[2].buffer= e; - bind[2].buffer_length= sizeof(e); - bind[2].length= &e_len; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= f; + my_bind[0].buffer_length= sizeof(f); + my_bind[0].length= &f_len; + my_bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].buffer= d; + my_bind[1].buffer_length= sizeof(d); + my_bind[1].length= &d_len; + my_bind[2].buffer_type= MYSQL_TYPE_STRING; + my_bind[2].buffer= e; + my_bind[2].buffer_length= sizeof(e); + my_bind[2].length= &e_len; - mysql_stmt_bind_result(stmt, bind); + mysql_stmt_bind_result(stmt, my_bind); mysql_stmt_store_result(stmt); rc= mysql_stmt_fetch(stmt); @@ -12340,7 +12340,7 @@ static void test_conversion() MYSQL_STMT *stmt; const char *stmt_text; int rc; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; char buff[4]; ulong length; @@ -12363,12 +12363,12 @@ static void test_conversion() rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); check_execute(stmt, rc); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer= buff; - bind[0].length= &length; - bind[0].buffer_type= MYSQL_TYPE_STRING; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer= buff; + my_bind[0].length= &length; + my_bind[0].buffer_type= MYSQL_TYPE_STRING; - mysql_stmt_bind_param(stmt, bind); + mysql_stmt_bind_param(stmt, my_bind); buff[0]= (uchar) 0xC3; buff[1]= (uchar) 0xA0; @@ -12383,8 +12383,8 @@ static void test_conversion() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - bind[0].buffer_length= sizeof(buff); - mysql_stmt_bind_result(stmt, bind); + my_bind[0].buffer_length= sizeof(buff); + mysql_stmt_bind_result(stmt, my_bind); rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == 0); @@ -12405,7 +12405,7 @@ static void test_conversion() static void test_rewind(void) { MYSQL_STMT *stmt; - MYSQL_BIND bind; + MYSQL_BIND my_bind; int rc = 0; const char *stmt_text; long unsigned int length=4, Data=0; @@ -12426,11 +12426,11 @@ static void test_rewind(void) rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); check_execute(stmt, rc); - bzero((char*) &bind, sizeof(MYSQL_BIND)); - bind.buffer_type= MYSQL_TYPE_LONG; - bind.buffer= (void *)&Data; /* this buffer won't be altered */ - bind.length= &length; - bind.is_null= &isnull; + bzero((char*) &my_bind, sizeof(MYSQL_BIND)); + my_bind.buffer_type= MYSQL_TYPE_LONG; + my_bind.buffer= (void *)&Data; /* this buffer won't be altered */ + my_bind.length= &length; + my_bind.is_null= &isnull; rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); @@ -12438,7 +12438,7 @@ static void test_rewind(void) rc= mysql_stmt_store_result(stmt); DIE_UNLESS(rc == 0); - rc= mysql_stmt_bind_result(stmt, &bind); + rc= mysql_stmt_bind_result(stmt, &my_bind); DIE_UNLESS(rc == 0); /* retreive all result sets till we are at the end */ @@ -12471,7 +12471,7 @@ static void test_truncation() const char *stmt_text; int rc; uint bind_count; - MYSQL_BIND *bind_array, *bind; + MYSQL_BIND *bind_array, *my_bind; myheader("test_truncation"); @@ -12523,86 +12523,86 @@ static void test_truncation() /*************** Fill in the bind structure and bind it **************/ bind_array= malloc(sizeof(MYSQL_BIND) * bind_count); bzero((char*) bind_array, sizeof(MYSQL_BIND) * bind_count); - for (bind= bind_array; bind < bind_array + bind_count; bind++) - bind->error= &bind->error_value; - bind= bind_array; - - bind->buffer= malloc(sizeof(uint8)); - bind->buffer_type= MYSQL_TYPE_TINY; - bind->is_unsigned= TRUE; - - DIE_UNLESS(++bind < bind_array + bind_count); - bind->buffer= malloc(sizeof(uint32)); - bind->buffer_type= MYSQL_TYPE_LONG; - bind->is_unsigned= TRUE; - - DIE_UNLESS(++bind < bind_array + bind_count); - bind->buffer= malloc(sizeof(int8)); - bind->buffer_type= MYSQL_TYPE_TINY; - - DIE_UNLESS(++bind < bind_array + bind_count); - bind->buffer= malloc(sizeof(uint16)); - bind->buffer_type= MYSQL_TYPE_SHORT; - bind->is_unsigned= TRUE; - - DIE_UNLESS(++bind < bind_array + bind_count); - bind->buffer= malloc(sizeof(int16)); - bind->buffer_type= MYSQL_TYPE_SHORT; - - DIE_UNLESS(++bind < bind_array + bind_count); - bind->buffer= malloc(sizeof(uint16)); - bind->buffer_type= MYSQL_TYPE_SHORT; - bind->is_unsigned= TRUE; - - DIE_UNLESS(++bind < bind_array + bind_count); - bind->buffer= malloc(sizeof(int8)); - bind->buffer_type= MYSQL_TYPE_TINY; - bind->is_unsigned= TRUE; - - DIE_UNLESS(++bind < bind_array + bind_count); - bind->buffer= malloc(sizeof(float)); - bind->buffer_type= MYSQL_TYPE_FLOAT; - - DIE_UNLESS(++bind < bind_array + bind_count); - bind->buffer= malloc(sizeof(float)); - bind->buffer_type= MYSQL_TYPE_FLOAT; - - DIE_UNLESS(++bind < bind_array + bind_count); - bind->buffer= malloc(sizeof(double)); - bind->buffer_type= MYSQL_TYPE_DOUBLE; - - DIE_UNLESS(++bind < bind_array + bind_count); - bind->buffer= malloc(sizeof(longlong)); - bind->buffer_type= MYSQL_TYPE_LONGLONG; - - DIE_UNLESS(++bind < bind_array + bind_count); - bind->buffer= malloc(sizeof(ulonglong)); - bind->buffer_type= MYSQL_TYPE_LONGLONG; - bind->is_unsigned= TRUE; - - DIE_UNLESS(++bind < bind_array + bind_count); - bind->buffer= malloc(sizeof(longlong)); - bind->buffer_type= MYSQL_TYPE_LONGLONG; - - DIE_UNLESS(++bind < bind_array + bind_count); - bind->buffer= malloc(sizeof(longlong)); - bind->buffer_type= MYSQL_TYPE_LONGLONG; - - DIE_UNLESS(++bind < bind_array + bind_count); - bind->buffer= malloc(sizeof(longlong)); - bind->buffer_type= MYSQL_TYPE_LONGLONG; - - DIE_UNLESS(++bind < bind_array + bind_count); - bind->buffer= malloc(sizeof(longlong)); - bind->buffer_type= MYSQL_TYPE_LONGLONG; - - DIE_UNLESS(++bind < bind_array + bind_count); - bind->buffer= malloc(sizeof(double)); - bind->buffer_type= MYSQL_TYPE_DOUBLE; - - DIE_UNLESS(++bind < bind_array + bind_count); - bind->buffer= malloc(sizeof(double)); - bind->buffer_type= MYSQL_TYPE_DOUBLE; + for (my_bind= bind_array; my_bind < bind_array + bind_count; my_bind++) + my_bind->error= &my_bind->error_value; + my_bind= bind_array; + + my_bind->buffer= malloc(sizeof(uint8)); + my_bind->buffer_type= MYSQL_TYPE_TINY; + my_bind->is_unsigned= TRUE; + + DIE_UNLESS(my_bind++ < bind_array + bind_count); + my_bind->buffer= malloc(sizeof(uint32)); + my_bind->buffer_type= MYSQL_TYPE_LONG; + my_bind->is_unsigned= TRUE; + + DIE_UNLESS(my_bind++ < bind_array + bind_count); + my_bind->buffer= malloc(sizeof(int8)); + my_bind->buffer_type= MYSQL_TYPE_TINY; + + DIE_UNLESS(my_bind++ < bind_array + bind_count); + my_bind->buffer= malloc(sizeof(uint16)); + my_bind->buffer_type= MYSQL_TYPE_SHORT; + my_bind->is_unsigned= TRUE; + + DIE_UNLESS(my_bind++ < bind_array + bind_count); + my_bind->buffer= malloc(sizeof(int16)); + my_bind->buffer_type= MYSQL_TYPE_SHORT; + + DIE_UNLESS(my_bind++ < bind_array + bind_count); + my_bind->buffer= malloc(sizeof(uint16)); + my_bind->buffer_type= MYSQL_TYPE_SHORT; + my_bind->is_unsigned= TRUE; + + DIE_UNLESS(my_bind++ < bind_array + bind_count); + my_bind->buffer= malloc(sizeof(int8)); + my_bind->buffer_type= MYSQL_TYPE_TINY; + my_bind->is_unsigned= TRUE; + + DIE_UNLESS(my_bind++ < bind_array + bind_count); + my_bind->buffer= malloc(sizeof(float)); + my_bind->buffer_type= MYSQL_TYPE_FLOAT; + + DIE_UNLESS(my_bind++ < bind_array + bind_count); + my_bind->buffer= malloc(sizeof(float)); + my_bind->buffer_type= MYSQL_TYPE_FLOAT; + + DIE_UNLESS(my_bind++ < bind_array + bind_count); + my_bind->buffer= malloc(sizeof(double)); + my_bind->buffer_type= MYSQL_TYPE_DOUBLE; + + DIE_UNLESS(my_bind++ < bind_array + bind_count); + my_bind->buffer= malloc(sizeof(longlong)); + my_bind->buffer_type= MYSQL_TYPE_LONGLONG; + + DIE_UNLESS(my_bind++ < bind_array + bind_count); + my_bind->buffer= malloc(sizeof(ulonglong)); + my_bind->buffer_type= MYSQL_TYPE_LONGLONG; + my_bind->is_unsigned= TRUE; + + DIE_UNLESS(my_bind++ < bind_array + bind_count); + my_bind->buffer= malloc(sizeof(longlong)); + my_bind->buffer_type= MYSQL_TYPE_LONGLONG; + + DIE_UNLESS(my_bind++ < bind_array + bind_count); + my_bind->buffer= malloc(sizeof(longlong)); + my_bind->buffer_type= MYSQL_TYPE_LONGLONG; + + DIE_UNLESS(my_bind++ < bind_array + bind_count); + my_bind->buffer= malloc(sizeof(longlong)); + my_bind->buffer_type= MYSQL_TYPE_LONGLONG; + + DIE_UNLESS(my_bind++ < bind_array + bind_count); + my_bind->buffer= malloc(sizeof(longlong)); + my_bind->buffer_type= MYSQL_TYPE_LONGLONG; + + DIE_UNLESS(my_bind++ < bind_array + bind_count); + my_bind->buffer= malloc(sizeof(double)); + my_bind->buffer_type= MYSQL_TYPE_DOUBLE; + + DIE_UNLESS(my_bind++ < bind_array + bind_count); + my_bind->buffer= malloc(sizeof(double)); + my_bind->buffer_type= MYSQL_TYPE_DOUBLE; rc= mysql_stmt_bind_result(stmt, bind_array); check_execute(stmt, rc); @@ -12610,82 +12610,82 @@ static void test_truncation() DIE_UNLESS(rc == MYSQL_DATA_TRUNCATED); /*************** Verify truncation results ***************************/ - bind= bind_array; + my_bind= bind_array; /* signed tiny -> tiny */ - DIE_UNLESS(*bind->error && * (int8*) bind->buffer == -10); + DIE_UNLESS(*my_bind->error && * (int8*) my_bind->buffer == -10); /* signed tiny -> uint32 */ - DIE_UNLESS(++bind < bind_array + bind_count); - DIE_UNLESS(*bind->error && * (int32*) bind->buffer == -10); + DIE_UNLESS(my_bind++ < bind_array + bind_count); + DIE_UNLESS(*my_bind->error && * (int32*) my_bind->buffer == -10); /* unsigned tiny -> tiny */ - DIE_UNLESS(++bind < bind_array + bind_count); - DIE_UNLESS(*bind->error && * (uint8*) bind->buffer == 200); + DIE_UNLESS(my_bind++ < bind_array + bind_count); + DIE_UNLESS(*my_bind->error && * (uint8*) my_bind->buffer == 200); /* short -> ushort */ - DIE_UNLESS(++bind < bind_array + bind_count); - DIE_UNLESS(*bind->error && * (int16*) bind->buffer == -32767); + DIE_UNLESS(my_bind++ < bind_array + bind_count); + DIE_UNLESS(*my_bind->error && * (int16*) my_bind->buffer == -32767); /* ushort -> short */ - DIE_UNLESS(++bind < bind_array + bind_count); - DIE_UNLESS(*bind->error && * (uint16*) bind->buffer == 64000); + DIE_UNLESS(my_bind++ < bind_array + bind_count); + DIE_UNLESS(*my_bind->error && * (uint16*) my_bind->buffer == 64000); /* short -> ushort (no truncation, data is in the range of target type) */ - DIE_UNLESS(++bind < bind_array + bind_count); - DIE_UNLESS(! *bind->error && * (uint16*) bind->buffer == 32000); + DIE_UNLESS(my_bind++ < bind_array + bind_count); + DIE_UNLESS(! *my_bind->error && * (uint16*) my_bind->buffer == 32000); /* ushort -> utiny */ - DIE_UNLESS(++bind < bind_array + bind_count); - DIE_UNLESS(*bind->error && * (int8*) bind->buffer == 0); + DIE_UNLESS(my_bind++ < bind_array + bind_count); + DIE_UNLESS(*my_bind->error && * (int8*) my_bind->buffer == 0); /* int -> float: no truncation, the number is a power of two */ - DIE_UNLESS(++bind < bind_array + bind_count); - DIE_UNLESS(! *bind->error && * (float*) bind->buffer == 1073741824); + DIE_UNLESS(my_bind++ < bind_array + bind_count); + DIE_UNLESS(! *my_bind->error && * (float*) my_bind->buffer == 1073741824); /* int -> float: truncation, not enough bits in float */ - DIE_UNLESS(++bind < bind_array + bind_count); - DIE_UNLESS(*bind->error); + DIE_UNLESS(my_bind++ < bind_array + bind_count); + DIE_UNLESS(*my_bind->error); /* int -> double: no truncation */ - DIE_UNLESS(++bind < bind_array + bind_count); - DIE_UNLESS(! *bind->error && * (double*) bind->buffer == 1073741825); + DIE_UNLESS(my_bind++ < bind_array + bind_count); + DIE_UNLESS(! *my_bind->error && * (double*) my_bind->buffer == 1073741825); /* double -> longlong: fractional part is lost */ - DIE_UNLESS(++bind < bind_array + bind_count); + DIE_UNLESS(my_bind++ < bind_array + bind_count); /* double -> ulonglong, negative fp number to unsigned integer */ - DIE_UNLESS(++bind < bind_array + bind_count); + DIE_UNLESS(my_bind++ < bind_array + bind_count); /* Value in the buffer is not defined: don't test it */ - DIE_UNLESS(*bind->error); + DIE_UNLESS(*my_bind->error); /* double -> longlong, negative fp number to signed integer: no loss */ - DIE_UNLESS(++bind < bind_array + bind_count); - DIE_UNLESS(! *bind->error && * (longlong*) bind->buffer == LL(-12345678910)); + DIE_UNLESS(my_bind++ < bind_array + bind_count); + DIE_UNLESS(! *my_bind->error && * (longlong*) my_bind->buffer == LL(-12345678910)); /* big numeric string -> number */ - DIE_UNLESS(++bind < bind_array + bind_count); - DIE_UNLESS(*bind->error); + DIE_UNLESS(my_bind++ < bind_array + bind_count); + DIE_UNLESS(*my_bind->error); /* junk string -> number */ - DIE_UNLESS(++bind < bind_array + bind_count); - DIE_UNLESS(*bind->error && *(longlong*) bind->buffer == 0); + DIE_UNLESS(my_bind++ < bind_array + bind_count); + DIE_UNLESS(*my_bind->error && *(longlong*) my_bind->buffer == 0); /* string with trailing spaces -> number */ - DIE_UNLESS(++bind < bind_array + bind_count); - DIE_UNLESS(! *bind->error && *(longlong*) bind->buffer == 12345); + DIE_UNLESS(my_bind++ < bind_array + bind_count); + DIE_UNLESS(! *my_bind->error && *(longlong*) my_bind->buffer == 12345); /* string with trailing spaces -> double */ - DIE_UNLESS(++bind < bind_array + bind_count); - DIE_UNLESS(! *bind->error && *(double*) bind->buffer == 12345.67); + DIE_UNLESS(my_bind++ < bind_array + bind_count); + DIE_UNLESS(! *my_bind->error && *(double*) my_bind->buffer == 12345.67); /* string with trailing junk -> double */ - DIE_UNLESS(++bind < bind_array + bind_count); + DIE_UNLESS(my_bind++ < bind_array + bind_count); /* XXX: There must be a truncation error: but it's not the way the server behaves, so let's leave it for now. */ - DIE_UNLESS(*(double*) bind->buffer == 12345.67); + DIE_UNLESS(*(double*) my_bind->buffer == 12345.67); /* TODO: string -> double, double -> time, double -> string (truncation errors are not supported here yet) @@ -12698,8 +12698,8 @@ static void test_truncation() mysql_stmt_close(stmt); - for (bind= bind_array; bind < bind_array + bind_count; bind++) - free(bind->buffer); + for (my_bind= bind_array; my_bind < bind_array + bind_count; my_bind++) + free(my_bind->buffer); free(bind_array); rc= mysql_query(mysql, "drop table t1"); @@ -12714,7 +12714,7 @@ static void test_truncation_option() uint8 buf; my_bool option= 0; my_bool error; - MYSQL_BIND bind; + MYSQL_BIND my_bind; myheader("test_truncation_option"); @@ -12727,14 +12727,14 @@ static void test_truncation_option() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - bzero((char*) &bind, sizeof(MYSQL_BIND)); + bzero((char*) &my_bind, sizeof(my_bind)); - bind.buffer= (void*) &buf; - bind.buffer_type= MYSQL_TYPE_TINY; - bind.is_unsigned= TRUE; - bind.error= &error; + my_bind.buffer= (void*) &buf; + my_bind.buffer_type= MYSQL_TYPE_TINY; + my_bind.is_unsigned= TRUE; + my_bind.error= &error; - rc= mysql_stmt_bind_result(stmt, &bind); + rc= mysql_stmt_bind_result(stmt, &my_bind); check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == MYSQL_DATA_TRUNCATED); @@ -12742,7 +12742,7 @@ static void test_truncation_option() rc= mysql_options(mysql, MYSQL_REPORT_DATA_TRUNCATION, (char*) &option); myquery(rc); /* need to rebind for the new setting to take effect */ - rc= mysql_stmt_bind_result(stmt, &bind); + rc= mysql_stmt_bind_result(stmt, &my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); @@ -12789,7 +12789,7 @@ static void test_bug8330() MYSQL_STMT *stmt[2]; int i, rc; const char *query= "select a,b from t1 where a=?"; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; long lval[2]; myheader("test_bug8330"); @@ -12802,17 +12802,17 @@ static void test_bug8330() rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); myquery(rc); - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); for (i=0; i < 2; i++) { stmt[i]= mysql_stmt_init(mysql); rc= mysql_stmt_prepare(stmt[i], query, strlen(query)); check_execute(stmt[i], rc); - bind[i].buffer_type= MYSQL_TYPE_LONG; - bind[i].buffer= (void*) &lval[i]; - bind[i].is_null= 0; - mysql_stmt_bind_param(stmt[i], &bind[i]); + my_bind[i].buffer_type= MYSQL_TYPE_LONG; + my_bind[i].buffer= (void*) &lval[i]; + my_bind[i].is_null= 0; + mysql_stmt_bind_param(stmt[i], &my_bind[i]); } rc= mysql_stmt_execute(stmt[0]); @@ -13060,7 +13060,7 @@ static void test_bug9159() static void test_bug9520() { MYSQL_STMT *stmt; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; char a[6]; ulong a_len; int rc, row_count= 0; @@ -13084,13 +13084,13 @@ static void test_bug9520() rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char*) a; - bind[0].buffer_length= sizeof(a); - bind[0].length= &a_len; + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (char*) a; + my_bind[0].buffer_length= sizeof(a); + my_bind[0].length= &a_len; - mysql_stmt_bind_result(stmt, bind); + mysql_stmt_bind_result(stmt, my_bind); while (!(rc= mysql_stmt_fetch(stmt))) row_count++; @@ -13116,7 +13116,7 @@ static void test_bug9520() static void test_bug9478() { MYSQL_STMT *stmt; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; char a[6]; ulong a_len; int rc, i; @@ -13133,12 +13133,12 @@ static void test_bug9478() stmt= open_cursor("select name from t1 where id=2"); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (char*) a; - bind[0].buffer_length= sizeof(a); - bind[0].length= &a_len; - mysql_stmt_bind_result(stmt, bind); + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (char*) a; + my_bind[0].buffer_length= sizeof(a); + my_bind[0].length= &a_len; + mysql_stmt_bind_result(stmt, my_bind); for (i= 0; i < 5; i++) { @@ -13202,7 +13202,7 @@ static void test_bug9478() /* Test the case with a server side cursor */ stmt= open_cursor("select name from t1"); - mysql_stmt_bind_result(stmt, bind); + mysql_stmt_bind_result(stmt, my_bind); for (i= 0; i < 5; i++) { @@ -13256,7 +13256,7 @@ static void test_bug9478() static void test_bug9643() { MYSQL_STMT *stmt; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; int32 a; int rc; const char *stmt_text; @@ -13290,11 +13290,11 @@ static void test_bug9643() rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); check_execute(stmt, rc); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void*) &a; - bind[0].buffer_length= sizeof(a); - mysql_stmt_bind_result(stmt, bind); + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void*) &a; + my_bind[0].buffer_length= sizeof(a); + mysql_stmt_bind_result(stmt, my_bind); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); @@ -13317,7 +13317,7 @@ static void test_bug9643() static void test_bug11111() { MYSQL_STMT *stmt; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; char buf[2][20]; ulong len[2]; int i; @@ -13346,16 +13346,16 @@ static void test_bug11111() mysql_stmt_prepare(stmt, query, strlen(query)); mysql_stmt_execute(stmt); - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); for (i=0; i < 2; i++) { - bind[i].buffer_type= MYSQL_TYPE_STRING; - bind[i].buffer= (gptr *)&buf[i]; - bind[i].buffer_length= 20; - bind[i].length= &len[i]; + my_bind[i].buffer_type= MYSQL_TYPE_STRING; + my_bind[i].buffer= (gptr *)&buf[i]; + my_bind[i].buffer_length= 20; + my_bind[i].length= &len[i]; } - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); @@ -13378,7 +13378,7 @@ static void test_bug11111() static void test_bug10729() { MYSQL_STMT *stmt; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; char a[21]; int rc; const char *stmt_text; @@ -13404,11 +13404,11 @@ static void test_bug10729() rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); check_execute(stmt, rc); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void*) a; - bind[0].buffer_length= sizeof(a); - mysql_stmt_bind_result(stmt, bind); + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void*) a; + my_bind[0].buffer_length= sizeof(a); + mysql_stmt_bind_result(stmt, my_bind); for (i= 0; i < 3; i++) { @@ -13489,7 +13489,7 @@ static void test_bug9992() static void test_bug10736() { MYSQL_STMT *stmt; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; char a[21]; int rc; const char *stmt_text; @@ -13514,11 +13514,11 @@ static void test_bug10736() rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); check_execute(stmt, rc); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void*) a; - bind[0].buffer_length= sizeof(a); - mysql_stmt_bind_result(stmt, bind); + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void*) a; + my_bind[0].buffer_length= sizeof(a); + mysql_stmt_bind_result(stmt, my_bind); for (i= 0; i < 3; i++) { @@ -13545,7 +13545,7 @@ static void test_bug10736() static void test_bug10794() { MYSQL_STMT *stmt, *stmt1; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; char a[21]; int id_val; ulong a_len; @@ -13563,13 +13563,13 @@ static void test_bug10794() stmt_text= "insert into t1 (id, name) values (?, ?)"; rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); check_execute(stmt, rc); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void*) &id_val; - bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer= (void*) a; - bind[1].length= &a_len; - rc= mysql_stmt_bind_param(stmt, bind); + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void*) &id_val; + my_bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].buffer= (void*) a; + my_bind[1].length= &a_len; + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); for (i= 0; i < 42; i++) { @@ -13585,12 +13585,12 @@ static void test_bug10794() mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type); stmt1= mysql_stmt_init(mysql); mysql_stmt_attr_set(stmt1, STMT_ATTR_CURSOR_TYPE, (const void*) &type); - bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void*) a; - bind[0].buffer_length= sizeof(a); - bind[0].length= &a_len; - rc= mysql_stmt_bind_result(stmt, bind); + bzero((char*) my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void*) a; + my_bind[0].buffer_length= sizeof(a); + my_bind[0].length= &a_len; + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); @@ -13604,7 +13604,7 @@ static void test_bug10794() stmt_text= "select name from t1 where id=10"; rc= mysql_stmt_prepare(stmt1, stmt_text, strlen(stmt_text)); check_execute(stmt1, rc); - rc= mysql_stmt_bind_result(stmt1, bind); + rc= mysql_stmt_bind_result(stmt1, my_bind); check_execute(stmt1, rc); rc= mysql_stmt_execute(stmt1); while (1) @@ -13703,7 +13703,7 @@ static void test_bug11172() static void test_bug11656() { MYSQL_STMT *stmt; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; int rc; const char *stmt_text; char buf[2][20]; @@ -13729,16 +13729,16 @@ static void test_bug11656() type= (ulong) CURSOR_TYPE_READ_ONLY; mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type); - bzero((char*) bind, sizeof(bind)); + bzero((char*) my_bind, sizeof(my_bind)); strmov(buf[0], "pcint502_MY2"); strmov(buf[1], "*"); for (i=0; i < 2; i++) { - bind[i].buffer_type= MYSQL_TYPE_STRING; - bind[i].buffer= (gptr *)&buf[i]; - bind[i].buffer_length= strlen(buf[i]); + my_bind[i].buffer_type= MYSQL_TYPE_STRING; + my_bind[i].buffer= (gptr *)&buf[i]; + my_bind[i].buffer_length= strlen(buf[i]); } - mysql_stmt_bind_param(stmt, bind); + mysql_stmt_bind_param(stmt, my_bind); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); @@ -13918,7 +13918,7 @@ static void test_bug11037() static void test_bug10760() { MYSQL_STMT *stmt; - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; int rc; const char *stmt_text; char id_buf[20]; @@ -13994,13 +13994,13 @@ static void test_bug10760() rc= mysql_query(mysql, "alter table t1 engine=InnoDB"); myquery(rc); - bzero(bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_STRING; - bind[0].buffer= (void*) id_buf; - bind[0].buffer_length= sizeof(id_buf); - bind[0].length= &id_len; + bzero(my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_STRING; + my_bind[0].buffer= (void*) id_buf; + my_bind[0].buffer_length= sizeof(id_buf); + my_bind[0].length= &id_len; check_execute(stmt, rc); - mysql_stmt_bind_result(stmt, bind); + mysql_stmt_bind_result(stmt, my_bind); rc= mysql_stmt_execute(stmt); rc= mysql_stmt_fetch(stmt); @@ -14079,7 +14079,7 @@ static void test_bug12001() static void test_bug11909() { MYSQL_STMT *stmt1, *stmt2; - MYSQL_BIND bind[7]; + MYSQL_BIND my_bind[7]; int rc; char firstname[20], midinit[20], lastname[20], workdept[20]; ulong firstname_len, midinit_len, lastname_len, workdept_len; @@ -14117,36 +14117,36 @@ static void test_bug11909() stmt1= open_cursor("SELECT empno, firstname, midinit, lastname," "workdept, salary, bonus FROM t1"); - bzero(bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= (void*) &empno; + bzero(my_bind, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= (void*) &empno; - bind[1].buffer_type= MYSQL_TYPE_VAR_STRING; - bind[1].buffer= (void*) firstname; - bind[1].buffer_length= sizeof(firstname); - bind[1].length= &firstname_len; + my_bind[1].buffer_type= MYSQL_TYPE_VAR_STRING; + my_bind[1].buffer= (void*) firstname; + my_bind[1].buffer_length= sizeof(firstname); + my_bind[1].length= &firstname_len; - bind[2].buffer_type= MYSQL_TYPE_VAR_STRING; - bind[2].buffer= (void*) midinit; - bind[2].buffer_length= sizeof(midinit); - bind[2].length= &midinit_len; + my_bind[2].buffer_type= MYSQL_TYPE_VAR_STRING; + my_bind[2].buffer= (void*) midinit; + my_bind[2].buffer_length= sizeof(midinit); + my_bind[2].length= &midinit_len; - bind[3].buffer_type= MYSQL_TYPE_VAR_STRING; - bind[3].buffer= (void*) lastname; - bind[3].buffer_length= sizeof(lastname); - bind[3].length= &lastname_len; + my_bind[3].buffer_type= MYSQL_TYPE_VAR_STRING; + my_bind[3].buffer= (void*) lastname; + my_bind[3].buffer_length= sizeof(lastname); + my_bind[3].length= &lastname_len; - bind[4].buffer_type= MYSQL_TYPE_VAR_STRING; - bind[4].buffer= (void*) workdept; - bind[4].buffer_length= sizeof(workdept); - bind[4].length= &workdept_len; + my_bind[4].buffer_type= MYSQL_TYPE_VAR_STRING; + my_bind[4].buffer= (void*) workdept; + my_bind[4].buffer_length= sizeof(workdept); + my_bind[4].length= &workdept_len; - bind[5].buffer_type= MYSQL_TYPE_DOUBLE; - bind[5].buffer= (void*) &salary; + my_bind[5].buffer_type= MYSQL_TYPE_DOUBLE; + my_bind[5].buffer= (void*) &salary; - bind[6].buffer_type= MYSQL_TYPE_FLOAT; - bind[6].buffer= (void*) &bonus; - rc= mysql_stmt_bind_result(stmt1, bind); + my_bind[6].buffer_type= MYSQL_TYPE_FLOAT; + my_bind[6].buffer= (void*) &bonus; + rc= mysql_stmt_bind_result(stmt1, my_bind); check_execute(stmt1, rc); rc= mysql_stmt_execute(stmt1); @@ -14163,7 +14163,7 @@ static void test_bug11909() DIE_UNLESS(bonus == (float) 1000.0); stmt2= open_cursor("SELECT empno, firstname FROM t1"); - rc= mysql_stmt_bind_result(stmt2, bind); + rc= mysql_stmt_bind_result(stmt2, my_bind); check_execute(stmt2, rc); rc= mysql_stmt_execute(stmt2); @@ -14197,7 +14197,7 @@ static void test_bug11909() static void test_bug11901() { MYSQL_STMT *stmt; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; int rc; char workdept[20]; ulong workdept_len; @@ -14288,19 +14288,19 @@ static void test_bug11901() " from (t1 left join t2 on t2.deptno = t1.workdept) " " where t1.empno = ?) " "order by 1"); - bzero(bind, sizeof(bind)); + bzero(my_bind, sizeof(my_bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer= &empno; - rc= mysql_stmt_bind_param(stmt, bind); + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer= &empno; + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); - bind[1].buffer_type= MYSQL_TYPE_VAR_STRING; - bind[1].buffer= (void*) workdept; - bind[1].buffer_length= sizeof(workdept); - bind[1].length= &workdept_len; + my_bind[1].buffer_type= MYSQL_TYPE_VAR_STRING; + my_bind[1].buffer= (void*) workdept; + my_bind[1].buffer_length= sizeof(workdept); + my_bind[1].length= &workdept_len; - rc= mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_bind_result(stmt, my_bind); check_execute(stmt, rc); empno= 10; @@ -14322,7 +14322,7 @@ static void test_bug11904() int rc; const char *stmt_text; const ulong type= (ulong)CURSOR_TYPE_READ_ONLY; - MYSQL_BIND bind[2]; + MYSQL_BIND my_bind[2]; int country_id=0; char row_data[11]= {0}; @@ -14349,18 +14349,18 @@ static void test_bug11904() rc= mysql_stmt_prepare(stmt1, stmt_text, strlen(stmt_text)); check_execute(stmt1, rc); - memset(bind, 0, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_LONG; - bind[0].buffer=& country_id; - bind[0].buffer_length= 0; - bind[0].length= 0; + memset(my_bind, 0, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_LONG; + my_bind[0].buffer=& country_id; + my_bind[0].buffer_length= 0; + my_bind[0].length= 0; - bind[1].buffer_type= MYSQL_TYPE_STRING; - bind[1].buffer=& row_data; - bind[1].buffer_length= sizeof(row_data) - 1; - bind[1].length= 0; + my_bind[1].buffer_type= MYSQL_TYPE_STRING; + my_bind[1].buffer=& row_data; + my_bind[1].buffer_length= sizeof(row_data) - 1; + my_bind[1].length= 0; - rc= mysql_stmt_bind_result(stmt1, bind); + rc= mysql_stmt_bind_result(stmt1, my_bind); check_execute(stmt1, rc); rc= mysql_stmt_execute(stmt1); @@ -14554,7 +14554,7 @@ static void test_bug14210() static void test_bug13488() { - MYSQL_BIND bind[3]; + MYSQL_BIND my_bind[3]; MYSQL_STMT *stmt1; int rc, f1, f2, f3, i; const ulong type= CURSOR_TYPE_READ_ONLY; @@ -14574,16 +14574,16 @@ static void test_bug13488() rc= mysql_query(mysql, "insert into t2 values (1,2), (2,4)"); myquery(rc); - memset(bind, 0, sizeof(bind)); + memset(my_bind, 0, sizeof(my_bind)); for (i= 0; i < 3; i++) { - bind[i].buffer_type= MYSQL_TYPE_LONG; - bind[i].buffer_length= 4; - bind[i].length= 0; + my_bind[i].buffer_type= MYSQL_TYPE_LONG; + my_bind[i].buffer_length= 4; + my_bind[i].length= 0; } - bind[0].buffer=&f1; - bind[1].buffer=&f2; - bind[2].buffer=&f3; + my_bind[0].buffer=&f1; + my_bind[1].buffer=&f2; + my_bind[2].buffer=&f3; stmt1= mysql_stmt_init(mysql); rc= mysql_stmt_attr_set(stmt1,STMT_ATTR_CURSOR_TYPE, (const void *)&type); @@ -14595,7 +14595,7 @@ static void test_bug13488() rc= mysql_stmt_execute(stmt1); check_execute(stmt1, rc); - rc= mysql_stmt_bind_result(stmt1, bind); + rc= mysql_stmt_bind_result(stmt1, my_bind); check_execute(stmt1, rc); rc= mysql_stmt_fetch(stmt1); @@ -15127,7 +15127,7 @@ static void test_bug14169() static void test_bug20152() { - MYSQL_BIND bind[1]; + MYSQL_BIND my_bind[1]; MYSQL_STMT *stmt; MYSQL_TIME tm; int rc; @@ -15135,9 +15135,9 @@ static void test_bug20152() myheader("test_bug20152"); - memset(bind, 0, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_DATE; - bind[0].buffer= (void*)&tm; + memset(my_bind, 0, sizeof(my_bind)); + my_bind[0].buffer_type= MYSQL_TYPE_DATE; + my_bind[0].buffer= (void*)&tm; tm.year = 2006; tm.month = 6; @@ -15154,7 +15154,7 @@ static void test_bug20152() stmt= mysql_stmt_init(mysql); rc= mysql_stmt_prepare(stmt, query, strlen(query)); check_execute(stmt, rc); - rc= mysql_stmt_bind_param(stmt, bind); + rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); |