574
574
field_count= min(mysql_num_fields(result), MAX_RES_FIELDS);
576
bzero((char*) buffer, sizeof(buffer));
577
bzero((char*) length, sizeof(length));
578
bzero((char*) is_null, sizeof(is_null));
576
memset((char*) buffer, 0, sizeof(buffer));
577
memset((char*) length, 0, sizeof(length));
578
memset((char*) is_null, 0, sizeof(is_null));
580
580
for(i= 0; i < field_count; i++)
742
742
fprintf(stdout, "\n table :`%s`\t(expected: `%s`)",
743
743
field->table, table);
745
745
fprintf(stdout, "\n org_table:`%s`\t(expected: `%s`)",
746
746
field->org_table, org_table);
747
747
fprintf(stdout, "\n database :`%s`\t(expected: `%s`)", field->db, db);
1600
1600
verify_param_count(stmt, 7);
1602
bzero((char*) my_bind, sizeof(my_bind));
1602
memset((char*) my_bind, 0, sizeof(my_bind));
1605
1605
my_bind[0].buffer_type= MYSQL_TYPE_TINY;
1776
1776
verify_param_count(stmt, 3);
1778
/* Always bzero bind array because there can be internal members */
1779
bzero((char*) my_bind, sizeof(my_bind));
1778
/* Always clear bind array because there can be internal members */
1779
memset((char*) my_bind, 0, sizeof(my_bind));
1782
1782
my_bind[0].buffer_type= MYSQL_TYPE_TINY;
1855
1855
verify_param_count(stmt, 2);
1857
/* Always bzero all members of bind parameter */
1858
bzero((char*) my_bind, sizeof(my_bind));
1857
/* Always clear all members of bind parameter */
1858
memset((char*) my_bind, 0, sizeof(my_bind));
1860
1860
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
1861
1861
my_bind[0].is_null= &is_null[0];
1960
1960
rc= mysql_query(mysql, "INSERT INTO test_ps_nulls values (1), (null)");
1963
/* Always bzero all members of bind parameter */
1964
bzero((char*) &in_bind, sizeof(in_bind));
1965
bzero((char*) &out_bind, sizeof(out_bind));
1963
/* Always clear all members of bind parameter */
1964
memset((char*) &in_bind, 0, sizeof(in_bind));
1965
memset((char*) &out_bind, sizeof(out_bind));
1967
1967
in_bind.buffer_type= MYSQL_TYPE_LONG;
1968
1968
in_bind.is_null= &in_is_null;
2040
bzero((char*) my_bind, sizeof(my_bind));
2040
memset((char*) my_bind, 0, sizeof(my_bind));
2041
2041
for (i= 0; i < (int) array_elements(my_bind); i++)
2043
2043
my_bind[i].buffer_type= MYSQL_TYPE_LONG;
2273
2273
verify_param_count(stmt, 2);
2275
/* Always bzero all members of bind parameter */
2276
bzero((char*) my_bind, sizeof(my_bind));
2275
/* Always clear all members of bind parameter */
2276
memset((char*) my_bind, 0, sizeof(my_bind));
2278
2278
/* string data */
2335
2335
verify_param_count(stmt, 2);
2337
/* Always bzero all members of bind parameter */
2338
bzero((char*) my_bind, sizeof(my_bind));
2337
/* Always clear all members of bind parameter */
2338
memset((char*) my_bind, 0, sizeof(my_bind));
2340
2340
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
2341
2341
my_bind[0].buffer= (void *)&int_data;
2529
bzero((char*) p_bind, sizeof(p_bind));
2529
memset((char*) p_bind, 0, sizeof(p_bind));
2530
2530
p_bind[0].buffer_type= MYSQL_TYPE_LONG;
2531
2531
p_bind[0].buffer= (void *)&p_int_data;
2532
2532
p_bind[1].buffer_type= MYSQL_TYPE_VAR_STRING;
2541
2541
strmov(p_str_data, "hh");
2542
2542
p_str_length= strlen(p_str_data);
2544
bzero((char*) r_bind, sizeof(r_bind));
2544
memset((char*) r_bind, 0, sizeof(r_bind));
2545
2545
r_bind[0].buffer_type= MYSQL_TYPE_LONG;
2546
2546
r_bind[0].buffer= (void *)&r_int_data;
2547
2547
r_bind[1].buffer_type= MYSQL_TYPE_VAR_STRING;
2680
2680
verify_param_count(stmt, 1);
2682
/* Always bzero all members of bind parameter */
2683
bzero((char*) my_bind, sizeof(my_bind));
2682
/* Always clear all members of bind parameter */
2683
memset((char*) my_bind, 0, sizeof(my_bind));
2685
2685
strmov(szData, (char *)"abc");
2686
2686
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
2765
2765
verify_param_count(stmt, 1);
2767
/* Always bzero all members of bind parameter */
2768
bzero((char*) my_bind, sizeof(my_bind));
2767
/* Always clear all members of bind parameter */
2768
memset((char*) my_bind, 0, sizeof(my_bind));
2770
2770
strmov(szData, (char *)"abc");
2771
2771
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
2854
2854
verify_param_count(stmt, 4);
2856
/* Always bzero all members of bind parameter */
2857
bzero((char*) my_bind, sizeof(my_bind));
2856
/* Always clear all members of bind parameter */
2857
memset((char*) my_bind, 0, sizeof(my_bind));
3035
3035
verify_param_count(stmt, 2);
3037
/* Always bzero all members of bind parameter */
3038
bzero((char*) my_bind, sizeof(my_bind));
3037
/* Always clear all members of bind parameter */
3038
memset((char*) my_bind, 0, sizeof(my_bind));
3041
3041
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
3108
3108
verify_param_count(stmt, 3);
3110
/* Always bzero all members of bind parameter */
3111
bzero((char*) my_bind, sizeof(my_bind));
3110
/* Always clear all members of bind parameter */
3111
memset((char*) my_bind, 0, sizeof(my_bind));
3113
3113
my_bind[0].buffer= (void *)&int_data;
3114
3114
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
3190
3190
verify_param_count(stmt, 2);
3192
/* Always bzero all members of bind parameter */
3193
bzero((char*) my_bind, sizeof(my_bind));
3192
/* Always clear all members of bind parameter */
3193
memset((char*) my_bind, 0, sizeof(my_bind));
3195
3195
my_bind[0].buffer= (void *)&length;
3196
3196
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
3283
3283
verify_param_count(stmt, 2);
3285
/* Always bzero all members of bind parameter */
3286
bzero((char*) my_bind, sizeof(my_bind));
3285
/* Always clear all members of bind parameter */
3286
memset((char*) my_bind, 0, sizeof(my_bind));
3288
3288
my_bind[0].buffer= data; /* string data */
3289
3289
my_bind[0].buffer_length= sizeof(data);
3375
3375
DIE_UNLESS(field->max_length == max_blob_length);
3377
3377
/* Fetch results into a data buffer that is smaller than data */
3378
bzero((char*) my_bind, sizeof(*my_bind));
3378
memset((char*) my_bind, 0, sizeof(*my_bind));
3379
3379
my_bind[0].buffer_type= MYSQL_TYPE_BLOB;
3380
3380
my_bind[0].buffer= (void *) &data; /* this buffer won't be altered */
3381
3381
my_bind[0].buffer_length= 16;
3391
3391
DIE_UNLESS(blob_length == max_blob_length);
3393
3393
/* Fetch all data */
3394
bzero((char*) (my_bind+1), sizeof(*my_bind));
3394
memset((char*) (my_bind+1), 0, sizeof(*my_bind));
3395
3395
my_bind[1].buffer_type= MYSQL_TYPE_BLOB;
3396
3396
my_bind[1].buffer= (void *) &data; /* this buffer won't be altered */
3397
3397
my_bind[1].buffer_length= sizeof(data);
3398
3398
my_bind[1].length= &blob_length;
3399
bzero(data, sizeof(data));
3399
memset(data, 0, sizeof(data));
3400
3400
mysql_stmt_fetch_column(stmt, my_bind+1, 0, 0);
3401
3401
DIE_UNLESS(strlen(data) == max_blob_length);
3440
3440
verify_param_count(stmt, 2);
3442
/* Always bzero all members of bind parameter */
3443
bzero((char*) my_bind, sizeof(my_bind));
3442
/* Always clear all members of bind parameter */
3443
memset((char*) my_bind, 0, sizeof(my_bind));
3445
3445
my_bind[0].buffer= (void *)&length;
3446
3446
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
3530
3530
verify_param_count(stmt, 2);
3532
/* Always bzero all members of bind parameter */
3533
bzero((char*) my_bind, sizeof(my_bind));
3532
/* Always memset all members of bind parameter */
3533
memset((char*) my_bind, 0, sizeof(my_bind));
3536
3536
strmov(szData, "MySQL");
3604
3604
verify_param_count(stmt, 2);
3606
/* Always bzero all members of bind parameter */
3607
bzero((char*) my_bind, sizeof(my_bind));
3606
/* Always memset all members of bind parameter */
3607
memset((char*) my_bind, 0, sizeof(my_bind));
3609
3609
/* string data */
3610
3610
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
3633
3633
verify_param_count(stmt, 2);
3636
/* Always bzero all members of bind parameter */
3637
bzero((char*) my_bind, sizeof(my_bind));
3636
/* Always clear all members of bind parameter */
3637
memset((char*) my_bind, 0, sizeof(my_bind));
3639
3639
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
3640
3640
my_bind[0].buffer= szData;
3757
bzero((char*) my_bind, sizeof(my_bind));
3757
memset((char*) my_bind, 0, sizeof(my_bind));
3758
3758
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
3759
3759
my_bind[0].buffer= (void *) &nData; /* integer data */
3760
3760
my_bind[0].is_null= &is_null[0];
3847
3847
rc= mysql_commit(mysql);
3850
bzero((char*) my_bind, sizeof(my_bind));
3850
memset((char*) my_bind, 0, sizeof(my_bind));
3851
3851
for (i= 0; i < (int) array_elements(my_bind); i++)
3853
3853
my_bind[i].length= &length[i];
3966
3966
rc= mysql_commit(mysql);
3969
bzero((char*) my_bind, sizeof(my_bind));
3969
memset((char*) my_bind, 0, sizeof(my_bind));
3970
3970
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
3971
3971
my_bind[0].buffer= (void *) t_data;
3972
3972
my_bind[0].buffer_length= sizeof(t_data);
4087
4087
verify_param_count(stmt, 7);
4089
/* Always bzero all members of bind parameter */
4090
bzero((char*) my_bind, sizeof(my_bind));
4089
/* Always clear all members of bind parameter */
4090
memset((char*) my_bind, 0, sizeof(my_bind));
4092
4092
for (i= 0; i < (int) array_elements(my_bind); i++)
4260
4260
rc= mysql_commit(mysql);
4263
bzero((char*) my_bind, sizeof(my_bind));
4263
memset((char*) my_bind, 0, sizeof(my_bind));
4264
4264
for (i= 0; i < array_elements(my_bind); i++)
4266
4266
my_bind[i].is_null= &is_null[i];
4589
4589
verify_param_count(stmt, 6);
4591
/* Always bzero all members of bind parameter */
4592
bzero((char*) my_bind, sizeof(my_bind));
4591
/* Always clear all members of bind parameter */
4592
memset((char*) my_bind, 0, sizeof(my_bind));
4595
4595
my_bind[0].buffer_type= MYSQL_TYPE_TINY;
4777
4777
verify_param_count(stmt, 2);
4780
We need to bzero bind structure because mysql_stmt_bind_param checks all
4780
We need to clear bind structure because mysql_stmt_bind_param checks all
4783
bzero((char*) my_bind, sizeof(my_bind));
4783
memset((char*) my_bind, 0, sizeof(my_bind));
4786
4786
my_bind[0].buffer_type= MYSQL_TYPE_TINY;
4999
4999
mysql_close(lmysql);
5002
We need to bzero bind structure because mysql_stmt_bind_param checks all
5002
We need to clear bind structure because mysql_stmt_bind_param checks all
5005
bzero((char*) my_bind, sizeof(my_bind));
5005
memset((char*) my_bind, sizeof(my_bind));
5007
5007
my_bind[0].buffer= (void *)&count;
5008
5008
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
5052
5052
check_stmt(stmt1);
5055
We need to bzero bind structure because mysql_stmt_bind_param checks all
5055
We need to clear bind structure because mysql_stmt_bind_param checks all
5058
bzero((char*) get_bind, sizeof(get_bind));
5058
memset((char*) get_bind, 0, sizeof(get_bind));
5060
5060
get_bind[0].buffer_type= MYSQL_TYPE_STRING;
5061
5061
get_bind[0].buffer= (void *)var;
5086
5086
stmt= mysql_simple_prepare(mysql, "set max_error_count= ?");
5087
5087
check_stmt(stmt);
5089
bzero((char*) set_bind, sizeof(set_bind));
5089
memset((char*) set_bind, 0, sizeof(set_bind));
5091
5091
set_bind[0].buffer_type= MYSQL_TYPE_LONG;
5092
5092
set_bind[0].buffer= (void *)&set_count;
5461
5461
verify_param_count(stmt, 1);
5464
We need to bzero bind structure because mysql_stmt_bind_param checks all
5464
We need to clear bind structure because mysql_stmt_bind_param checks all
5467
bzero((char*) my_bind, sizeof(my_bind));
5467
memset((char*) my_bind, 0, sizeof(my_bind));
5469
5469
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
5470
5470
my_bind[0].buffer= (void *)&id;
5622
5622
/* Bind the data for the parameters */
5625
We need to bzero bind structure because mysql_stmt_bind_param checks all
5625
We need to clear bind structure because mysql_stmt_bind_param checks all
5628
bzero((char*) my_bind, sizeof(my_bind));
5628
memset((char*) my_bind, 0, sizeof(my_bind));
5630
5630
/* INTEGER PART */
5631
5631
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
5749
5749
verify_param_count(stmt, 1);
5752
We need to bzero bind structure because mysql_stmt_bind_param checks all
5752
We need to clear bind structure because mysql_stmt_bind_param checks all
5755
bzero((char*) my_bind, sizeof(my_bind));
5755
memset((char*) my_bind, 0, sizeof(my_bind));
5758
5758
my_bind[0].buffer_type= MYSQL_TYPE_SHORT;
5998
bzero((char*) my_bind, sizeof(my_bind));
5998
memset((char*) my_bind, 0, sizeof(my_bind));
5999
5999
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
6000
6000
my_bind[0].buffer= (void *) &nData; /* integer data */
6001
6001
my_bind[0].length= &length;
6182
We need to bzero bind structure because mysql_stmt_bind_param checks all
6182
We need to clear bind structure because mysql_stmt_bind_param checks all
6185
bzero((char*) my_bind, sizeof(my_bind));
6185
memset((char*) my_bind, 0, sizeof(my_bind));
6187
6187
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
6188
6188
my_bind[0].buffer= (void *) &nData; /* integer data */
6276
We need to bzero bind structure because mysql_stmt_bind_param checks all
6276
We need to clear bind structure because mysql_stmt_bind_param checks all
6279
bzero((char*) my_bind, sizeof(my_bind));
6279
memset((char*) my_bind, 0, sizeof(my_bind));
6281
6281
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
6282
6282
my_bind[0].buffer= (void *) &id;
6378
6378
verify_param_count(stmt, 4);
6381
We need to bzero bind structure because mysql_stmt_bind_param checks all
6381
We need to clear bind structure because mysql_stmt_bind_param checks all
6384
bzero((char*) my_bind, sizeof(my_bind));
6384
memset((char*) my_bind, 0, sizeof(my_bind));
6386
6386
my_bind[0].buffer_type= MYSQL_TYPE_TIMESTAMP;
6387
6387
my_bind[1].buffer_type= MYSQL_TYPE_TIME;
6635
6635
check_stmt(stmt);
6638
We need to bzero bind structure because mysql_stmt_bind_param checks all
6638
We need to clear bind structure because mysql_stmt_bind_param checks all
6641
bzero((char*) my_bind, sizeof(my_bind));
6641
memset((char*) my_bind, 0, sizeof(my_bind));
6643
6643
my_bind[0].length= &length;
6644
6644
my_bind[0].is_null= 0;
6708
6708
rc= mysql_stmt_execute(stmt);
6709
6709
check_execute(stmt, rc);
6711
bzero(buffer, sizeof(buffer)); /* Avoid overruns in printf() */
6711
memset(buffer, 0, sizeof(buffer)); /* Avoid overruns in printf() */
6713
bzero((char*) my_bind, sizeof(my_bind));
6713
memset((char*) my_bind, 0, sizeof(my_bind));
6714
6714
my_bind[0].length= &length;
6715
6715
my_bind[0].is_null= &is_null;
6716
6716
my_bind[0].buffer_length= 1;
6899
6899
fprintf(stdout, "\n total rows : %d", rc);
6900
6900
DIE_UNLESS(rc == 1);
6902
bzero((char*) my_bind, sizeof(MYSQL_BIND));
6902
memset((char*) my_bind, 0, sizeof(MYSQL_BIND));
6903
6903
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
6904
6904
my_bind[0].buffer= (void *)str[0];
6905
6905
my_bind[0].buffer_length= sizeof(str[0]);
6969
6969
rc= mysql_stmt_execute(stmt);
6970
6970
check_execute(stmt, rc);
6972
bzero((char*) my_bind, sizeof(my_bind));
6972
memset((char*) my_bind, 0, sizeof(my_bind));
6973
6973
my_bind[0].buffer_type= MYSQL_TYPE_SHORT;
6974
6974
my_bind[0].buffer= (void *)&short_value;
6975
6975
my_bind[0].is_unsigned= TRUE;
7057
7057
rc= mysql_stmt_execute(stmt);
7058
7058
check_execute(stmt, rc);
7060
bzero((char*) my_bind, sizeof(my_bind));
7060
memset((char*) my_bind, 0, sizeof(my_bind));
7061
7061
my_bind[0].buffer_type= MYSQL_TYPE_SHORT;
7062
7062
my_bind[0].buffer= (void *)&short_value;
7063
7063
my_bind[0].length= &s_length;
7144
7144
rc= mysql_stmt_execute(stmt);
7145
7145
check_execute(stmt, rc);
7147
bzero((char*) my_bind, sizeof(my_bind));
7147
memset((char*) my_bind, 0, sizeof(my_bind));
7148
7148
my_bind[0].buffer_type= MYSQL_TYPE_SHORT;
7149
7149
my_bind[0].buffer= (void *)&short_value;
7150
7150
my_bind[0].length= &s_length;
7252
7252
rc= mysql_stmt_execute(stmt);
7253
7253
check_execute(stmt, rc);
7255
bzero((char*) my_bind, sizeof(my_bind));
7255
memset((char*) my_bind, 0, sizeof(my_bind));
7256
7256
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
7257
7257
my_bind[0].buffer= table_type;
7258
7258
my_bind[0].length= &type_length;
7564
7564
rc= mysql_stmt_execute(stmt);
7565
7565
check_execute(stmt, rc);
7567
bzero((char*) my_bind, sizeof(my_bind));
7567
memset((char*) my_bind, 0, sizeof(my_bind));
7568
7568
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
7569
7569
my_bind[0].buffer= data_dir;
7570
7570
my_bind[0].buffer_length= FN_REFLEN;
7649
7649
check_stmt(stmt);
7652
We need to bzero bind structure because mysql_stmt_bind_param checks all
7652
We need to clear bind structure because mysql_stmt_bind_param checks all
7655
bzero((char*) my_bind, sizeof(my_bind));
7655
memset((char*) my_bind, 0, sizeof(my_bind));
7657
7657
my_bind[0].buffer_type= MYSQL_TYPE_NEWDECIMAL;
7658
7658
my_bind[0].buffer= (void *)data;
7851
verify_prepare_field(result, 6, "key_len", "", MYSQL_TYPE_VAR_STRING, "",
7851
verify_prepare_field(result, 6, "key_len", "", MYSQL_TYPE_VAR_STRING, "",
7852
7852
"", "", 320, 0);
8087
8087
check_stmt(stmt);
8090
We need to bzero bind structure because mysql_stmt_bind_param checks all
8090
We need to clear bind structure because mysql_stmt_bind_param checks all
8093
bzero((char*) my_bind, sizeof(my_bind));
8093
memset((char*) my_bind, 0, sizeof(my_bind));
8095
8095
my_bind[0].buffer_type= MYSQL_TYPE_SHORT;
8096
8096
my_bind[0].buffer= (void *)&id;
8240
We need to bzero bind structure because mysql_stmt_bind_param checks all
8240
We need to clear bind structure because mysql_stmt_bind_param checks all
8243
bzero((char*) my_bind, sizeof(my_bind));
8243
memset((char*) my_bind, 0, sizeof(my_bind));
8245
8245
my_bind[0].buffer= (void *)&i;
8246
8246
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
8314
8314
stmt= mysql_simple_prepare(mysql, "select * from t1");
8315
8315
check_stmt(stmt);
8317
bzero((char*) my_bind, sizeof(my_bind));
8317
memset((char*) my_bind, 0, sizeof(my_bind));
8318
8318
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
8319
8319
my_bind[0].buffer= (void *)&c1;
8410
8410
stmt= mysql_simple_prepare(mysql, "select * from t1");
8411
8411
check_stmt(stmt);
8413
bzero((char*) my_bind, sizeof(my_bind));
8413
memset((char*) my_bind, 0, sizeof(my_bind));
8414
8414
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
8415
8415
my_bind[0].buffer= (void *)data;
8416
8416
my_bind[0].buffer_length= 11;
8497
8497
stmt= mysql_simple_prepare(mysql, "select * from t1 order by c2 desc");
8498
8498
check_stmt(stmt);
8500
bzero((char*) my_bind, sizeof(my_bind));
8500
memset((char*) my_bind, 0, sizeof(my_bind));
8501
8501
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
8502
8502
my_bind[0].buffer= (void *)&bc1;
8503
8503
my_bind[0].buffer_length= 0;
8779
8779
stmt= mysql_simple_prepare(mysql, "select * from test_free_result");
8780
8780
check_stmt(stmt);
8782
bzero((char*) my_bind, sizeof(my_bind));
8782
memset((char*) my_bind, 0, sizeof(my_bind));
8783
8783
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
8784
8784
my_bind[0].buffer= (void *)&bc1;
8785
8785
my_bind[0].length= &bl1;
8859
8859
stmt= mysql_simple_prepare(mysql, "select * from test_free_result");
8860
8860
check_stmt(stmt);
8862
bzero((char*) my_bind, sizeof(my_bind));
8862
memset((char*) my_bind, 0, sizeof(my_bind));
8863
8863
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
8864
8864
my_bind[0].buffer= (void *)&bc1;
8865
8865
my_bind[0].buffer_length= 0;
8952
8952
fprintf(stdout, "\n total parameters: %ld", mysql_stmt_param_count(stmt));
8955
We need to bzero bind structure because mysql_stmt_bind_param checks all
8955
We need to clear bind structure because mysql_stmt_bind_param checks all
8958
bzero((char*) my_bind, sizeof(my_bind));
8958
memset((char*) my_bind, 0, sizeof(my_bind));
8960
8960
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
8961
8961
my_bind[0].buffer= (void *)c1;
9095
9095
length= (long)(strmov(strts, "2003-07-12 21:07:46") - strts);
9098
We need to bzero bind structure because mysql_stmt_bind_param checks all
9098
We need to clear bind structure because mysql_stmt_bind_param checks all
9101
bzero((char*) my_bind, sizeof(my_bind));
9101
memset((char*) my_bind, 0, sizeof(my_bind));
9103
9103
my_bind[0].buffer_type= MYSQL_TYPE_TIMESTAMP;
9104
9104
my_bind[0].buffer= (void *)&ts;
9198
9198
verify_param_count(stmt, 3);
9201
We need to bzero bind structure because mysql_stmt_bind_param checks all
9201
We need to clear bind structure because mysql_stmt_bind_param checks all
9204
bzero((char*) my_bind, sizeof(my_bind));
9204
memset((char*) my_bind, 0, sizeof(my_bind));
9206
9206
my_bind[0].buffer= (void *)int_data;
9207
9207
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
9676
9676
rc= mysql_stmt_execute(stmt);
9677
9677
check_execute(stmt, rc);
9679
bzero((char*) &buffer, sizeof(buffer));
9679
memset((char*) &buffer, 0, sizeof(buffer));
9680
9680
buffer.buffer_type= MYSQL_TYPE_LONGLONG;
9681
9681
buffer.buffer_length= sizeof(lii);
9682
9682
buffer.buffer= (void *)&lii;
9994
9994
myheader("test_multi");
9997
We need to bzero bind structure because mysql_stmt_bind_param checks all
9997
We need to clear bind structure because mysql_stmt_bind_param checks all
10000
bzero((char*) my_bind, sizeof(my_bind));
10000
memset((char*) my_bind, 0, sizeof(my_bind));
10002
10002
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
10003
10003
my_bind[0].buffer= (void *)¶m;
10144
10144
check_stmt(stmt_insert);
10146
10146
/* bind parameters */
10147
bzero((char*) my_bind, sizeof(my_bind));
10147
memset((char*) my_bind, 0, sizeof(my_bind));
10149
10149
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
10150
10150
my_bind[0].buffer= (void *)&my_val;
10190
10190
stmt= mysql_simple_prepare(mysql, query);
10191
10191
check_stmt(stmt);
10193
We need to bzero bind structure because mysql_stmt_bind_param checks all
10193
We need to clear bind structure because mysql_stmt_bind_param checks all
10196
bzero((char*) my_bind, sizeof(my_bind));
10196
memset((char*) my_bind, 0, sizeof(my_bind));
10198
10198
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
10199
10199
my_bind[0].buffer= (void *)&my_val;
10325
10325
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
10328
bzero((char*) bind_array, sizeof(bind_array));
10328
memset((char*) bind_array, 0, sizeof(bind_array));
10330
10330
for (my_bind= bind_array; my_bind < bind_end; my_bind++)
10331
10331
my_bind->error= &my_bind->error_value;
10535
10535
verify_param_count(stmt, 2);
10537
bzero((char*) my_bind, sizeof(my_bind));
10537
memset((char*) my_bind, 0, sizeof(my_bind));
10539
10539
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
10540
10540
my_bind[0].buffer= (void *)str_data;
10705
10705
check_stmt(stmt);
10708
We need to bzero bind structure because mysql_stmt_bind_param checks all
10708
We need to clear bind structure because mysql_stmt_bind_param checks all
10711
bzero((char*) my_bind, sizeof(my_bind));
10711
memset((char*) my_bind, 0, sizeof(my_bind));
10713
10713
/* bind parameters */
10714
10714
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
10775
10775
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
10778
bzero((char*) bind_array, sizeof(bind_array));
10778
memset((char*) bind_array, 0, sizeof(bind_array));
10780
10780
bind_array[0].buffer_type= MYSQL_TYPE_STRING;
10781
10781
bind_array[0].buffer= (void *) koi8;
10959
10959
check_execute(stmt, rc);
10961
10961
/* Bind input buffers */
10962
bzero((char*) my_bind, sizeof(my_bind));
10962
memset((char*) my_bind, 0, sizeof(my_bind));
10964
10964
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
10965
10965
my_bind[0].buffer= (void *) concat_arg0;
11026
11026
check_execute(stmt, rc);
11028
11028
/* Bind input buffers */
11029
bzero((char*) my_bind, sizeof(my_bind));
11030
bzero((char*) &time_in, sizeof(time_in));
11031
bzero((char*) &time_out, sizeof(time_out));
11032
bzero((char*) &datetime_in, sizeof(datetime_in));
11033
bzero((char*) &datetime_out, sizeof(datetime_out));
11029
memset((char*) my_bind, 0, sizeof(my_bind));
11030
memset((char*) &time_in, 0, sizeof(time_in));
11031
memset((char*) &time_out, 0, sizeof(time_out));
11032
memset((char*) &datetime_in, 0, sizeof(datetime_in));
11033
memset((char*) &datetime_out, 0, sizeof(datetime_out));
11035
11035
my_bind[0].buffer_type= MYSQL_TYPE_TIME;
11036
11036
my_bind[0].buffer= (void *) &time_in;
11108
11108
check_execute(stmt, rc);
11110
11110
/* Bind input buffers */
11111
bzero((char*) my_bind, sizeof(my_bind));
11111
memset((char*) my_bind, 0, sizeof(my_bind));
11113
11113
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
11114
11114
my_bind[0].buffer= (void *) &res;
11177
11177
check_execute(stmt, rc);
11179
11179
/* Bind output buffers */
11180
bzero((char*) my_bind, sizeof(my_bind));
11181
bzero((char*) &time_canonical, sizeof(time_canonical));
11182
bzero((char*) &time_out, sizeof(time_out));
11183
bzero((char*) &date_canonical, sizeof(date_canonical));
11184
bzero((char*) &date_out, sizeof(date_out));
11185
bzero((char*) &datetime_canonical, sizeof(datetime_canonical));
11186
bzero((char*) &datetime_out, sizeof(datetime_out));
11180
memset((char*) my_bind, 0, sizeof(my_bind));
11181
memset((char*) &time_canonical, 0, sizeof(time_canonical));
11182
memset((char*) &time_out, 0, sizeof(time_out));
11183
memset((char*) &date_canonical, 0, sizeof(date_canonical));
11184
memset((char*) &date_out, 0, sizeof(date_out));
11185
memset((char*) &datetime_canonical, 0, sizeof(datetime_canonical));
11186
memset((char*) &datetime_out, 0, sizeof(datetime_out));
11188
11188
my_bind[0].buffer_type= MYSQL_TYPE_TIME;
11189
11189
my_bind[0].buffer= (void *) &time_out;
11286
11286
check_execute(stmt, rc);
11288
11288
strmov(str_data, "TEST");
11289
bzero((char*) my_bind, sizeof(my_bind));
11289
memset((char*) my_bind, 0, sizeof(my_bind));
11290
11290
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
11291
11291
my_bind[0].buffer= (char *)&str_data;
11292
11292
my_bind[0].buffer_length= 50;
11407
11407
" AENAME,T0001.DEPENDVARS AS DEPENDVARS,T0001.INACTIVE AS "
11408
11408
" INACTIVE from LTDX T0001 where (T0001.SRTF2 = 0)");
11410
bzero((char*) my_bind, sizeof(my_bind));
11410
memset((char*) my_bind, 0, sizeof(my_bind));
11411
11411
for (i=0; i < 8; i++) {
11412
11412
strmov(parms[i], "1");
11413
11413
my_bind[i].buffer_type = MYSQL_TYPE_VAR_STRING;
11458
11458
rc= mysql_query(mysql, "CREATE VIEW vt1 AS SELECT a FROM t1");
11460
bzero((char*) my_bind, sizeof(my_bind));
11460
memset((char*) my_bind, 0, sizeof(my_bind));
11461
11461
for (i= 0; i < 2; i++) {
11462
11462
sprintf((char *)&parms[i], "%d", i);
11463
11463
my_bind[i].buffer_type = MYSQL_TYPE_VAR_STRING;
11524
11524
rc= mysql_stmt_prepare(select_stmt, query, strlen(query));
11525
11525
check_execute(select_stmt, rc);
11527
bzero((char*) my_bind, sizeof(my_bind));
11527
memset((char*) my_bind, 0, sizeof(my_bind));
11528
11528
my_bind[0].buffer_type = MYSQL_TYPE_LONG;
11529
11529
my_bind[0].buffer = (char *)&my_val;
11530
11530
my_bind[0].length = &my_length;
11631
11631
" F7F8 AS F7F8, F6N4 AS F6N4, F5C8 AS F5C8, F9D8 AS F9D8"
11632
11632
" from t1 T0001");
11634
bzero((char*) my_bind, sizeof(my_bind));
11634
memset((char*) my_bind, 0, sizeof(my_bind));
11635
11635
for (i= 0; i < 11; i++)
11700
11700
check_execute(stmt, rc);
11702
11702
/* Bind output buffers */
11703
bzero((char*) my_bind, sizeof(my_bind));
11703
memset((char*) my_bind, 0, sizeof(my_bind));
11705
11705
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
11706
11706
my_bind[0].buffer= &c1;
11746
11746
check_execute(stmt, rc);
11748
11748
/* Bind input buffers */
11749
bzero((char*) my_bind, sizeof(my_bind));
11750
bzero((char*) tm, sizeof(tm));
11749
memset((char*) my_bind, 0, sizeof(my_bind));
11750
memset((char*) tm, 0, sizeof(tm));
11752
11752
my_bind[0].buffer_type= MYSQL_TYPE_DATE;
11753
11753
my_bind[0].buffer= &tm[0];
11797
11797
Ascii 97 is 'a', which gets mapped to Ascii 65 'A' unless internal
11798
11798
statement id hash in the server uses binary collation.
11800
#define NUM_OF_USED_STMT 97
11800
#define NUM_OF_USED_STMT 97
11801
11801
MYSQL_STMT *stmt_list[NUM_OF_USED_STMT];
11802
11802
MYSQL_STMT **stmt;
11803
11803
MYSQL_BIND my_bind[1];
11808
11808
myheader("test_bug5399");
11810
bzero((char*) my_bind, sizeof(my_bind));
11810
memset((char*) my_bind, 0, sizeof(my_bind));
11811
11811
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
11812
11812
my_bind[0].buffer= &no;
11967
11967
param_str_length= strlen(param_str);
11969
11969
/* setup bind array */
11970
bzero((char*) my_bind, MAX_PARAM_COUNT * sizeof(MYSQL_BIND));
11970
memset((char*) my_bind, 0, MAX_PARAM_COUNT * sizeof(MYSQL_BIND));
11971
11971
for (i= 0; i < MAX_PARAM_COUNT; ++i)
11973
11973
my_bind[i].buffer_type= MYSQL_TYPE_FLOAT;
12094
12094
rc= mysql_stmt_execute(stmt);
12095
12095
check_execute(stmt, rc);
12097
bzero((char*) my_bind, sizeof(my_bind));
12097
memset((char*) my_bind, 0, sizeof(my_bind));
12098
12098
my_bind[0].buffer_type = MYSQL_TYPE_STRING;
12099
12099
my_bind[0].buffer = &buffer;
12100
12100
my_bind[0].buffer_length = sizeof(buffer);
12143
12143
rc= mysql_stmt_execute(stmt);
12144
12144
check_execute(stmt, rc);
12146
bzero((char*) my_bind, sizeof(my_bind));
12146
memset((char*) my_bind, 0, sizeof(my_bind));
12147
12147
my_bind[0].buffer_type = MYSQL_TYPE_STRING;
12148
12148
my_bind[0].buffer = &buffer;
12149
12149
my_bind[0].buffer_length = sizeof(buffer);
12211
12211
check_execute(stmt, rc);
12214
bzero((char*) my_bind, sizeof(my_bind));
12214
memset((char*) my_bind, 0, sizeof(my_bind));
12215
12215
my_bind[0].buffer= &b;
12216
12216
my_bind[0].buffer_type= MYSQL_TYPE_SHORT;
12415
12415
/* Bind and fetch the data */
12417
bzero((char*) my_bind, sizeof(my_bind));
12417
memset((char*) my_bind, 0, sizeof(my_bind));
12418
12418
for (i= 0; i < stmt_field_count; ++i)
12420
12420
my_bind[i].buffer_type= MYSQL_TYPE_STRING;
12469
12469
check_stmt(stmt);
12470
12470
verify_param_count(stmt, 6);
12472
bzero((char*) my_bind, sizeof(my_bind));
12472
memset((char*) my_bind, 0, sizeof(my_bind));
12473
12473
for (i= 0; i < 6; i++)
12475
12475
my_bind[i].buffer_type= MYSQL_TYPE_DATETIME;
12600
12600
rc= mysql_stmt_execute(stmt);
12601
12601
check_execute(stmt, rc);
12603
bzero((char*) my_bind, sizeof(my_bind));
12603
memset((char*) my_bind, 0, sizeof(my_bind));
12604
12604
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
12605
12605
my_bind[0].buffer= f;
12606
12606
my_bind[0].buffer_length= sizeof(f);
12667
12667
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
12668
12668
check_execute(stmt, rc);
12670
bzero((char*) my_bind, sizeof(my_bind));
12670
memset((char*) my_bind, 0, sizeof(my_bind));
12671
12671
my_bind[0].buffer= buff;
12672
12672
my_bind[0].length= &length;
12673
12673
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
12730
12730
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
12731
12731
check_execute(stmt, rc);
12733
bzero((char*) &my_bind, sizeof(MYSQL_BIND));
12733
memset((char*) &my_bind, 0, sizeof(MYSQL_BIND));
12734
12734
my_bind.buffer_type= MYSQL_TYPE_LONG;
12735
12735
my_bind.buffer= (void *)&Data; /* this buffer won't be altered */
12736
12736
my_bind.length= &length;
12760
12760
while(!(rc= mysql_stmt_fetch(stmt)))
12761
12761
if (!opt_silent)
12762
12762
printf("fetched result after seek:%ld\n", Data);
12764
12764
DIE_UNLESS(rc == MYSQL_NO_DATA);
12766
12766
stmt_text= "DROP TABLE t1";
12829
12829
/*************** Fill in the bind structure and bind it **************/
12830
12830
bind_array= malloc(sizeof(MYSQL_BIND) * bind_count);
12831
bzero((char*) bind_array, sizeof(MYSQL_BIND) * bind_count);
12831
memset((char*) bind_array, 0, sizeof(MYSQL_BIND) * bind_count);
12832
12832
for (my_bind= bind_array; my_bind < bind_array + bind_count; my_bind++)
12833
12833
my_bind->error= &my_bind->error_value;
12834
12834
my_bind= bind_array;
13033
13033
rc= mysql_stmt_execute(stmt);
13034
13034
check_execute(stmt, rc);
13036
bzero((char*) &my_bind, sizeof(my_bind));
13036
memset((char*) &my_bind, 0, sizeof(my_bind));
13038
13038
my_bind.buffer= (void*) &buf;
13039
13039
my_bind.buffer_type= MYSQL_TYPE_TINY;
13108
13108
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
13111
bzero((char*) my_bind, sizeof(my_bind));
13111
memset((char*) my_bind, 0, sizeof(my_bind));
13112
13112
for (i=0; i < 2; i++)
13114
13114
stmt[i]= mysql_stmt_init(mysql);
13351
13351
DIE_UNLESS(memcmp(out, TEST_BUG8378_OUT, len) == 0);
13353
13353
sprintf(buf, "SELECT '%s'", out);
13355
13355
rc=mysql_real_query(lmysql, buf, strlen(buf));
13497
13497
rc= mysql_stmt_execute(stmt);
13498
13498
check_execute(stmt, rc);
13500
bzero((char*) my_bind, sizeof(my_bind));
13500
memset((char*) my_bind, 0, sizeof(my_bind));
13501
13501
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
13502
13502
my_bind[0].buffer= (char*) a;
13503
13503
my_bind[0].buffer_length= sizeof(a);
13548
13548
stmt= open_cursor("select name from t1 where id=2");
13550
bzero((char*) my_bind, sizeof(my_bind));
13550
memset((char*) my_bind, 0, sizeof(my_bind));
13551
13551
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
13552
13552
my_bind[0].buffer= (char*) a;
13553
13553
my_bind[0].buffer_length= sizeof(a);
13705
13705
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
13706
13706
check_execute(stmt, rc);
13708
bzero((char*) my_bind, sizeof(my_bind));
13708
memset((char*) my_bind, 0, sizeof(my_bind));
13709
13709
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
13710
13710
my_bind[0].buffer= (void*) &a;
13711
13711
my_bind[0].buffer_length= sizeof(a);
13761
13761
mysql_stmt_prepare(stmt, query, strlen(query));
13762
13762
mysql_stmt_execute(stmt);
13764
bzero((char*) my_bind, sizeof(my_bind));
13764
memset((char*) my_bind, 0, sizeof(my_bind));
13765
13765
for (i=0; i < 2; i++)
13767
13767
my_bind[i].buffer_type= MYSQL_TYPE_STRING;
13819
13819
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
13820
13820
check_execute(stmt, rc);
13822
bzero((char*) my_bind, sizeof(my_bind));
13822
memset((char*) my_bind, 0, sizeof(my_bind));
13823
13823
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
13824
13824
my_bind[0].buffer= (void*) a;
13825
13825
my_bind[0].buffer_length= sizeof(a);
13929
13929
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
13930
13930
check_execute(stmt, rc);
13932
bzero((char*) my_bind, sizeof(my_bind));
13932
memset((char*) my_bind, 0, sizeof(my_bind));
13933
13933
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
13934
13934
my_bind[0].buffer= (void*) a;
13935
13935
my_bind[0].buffer_length= sizeof(a);
13978
13978
stmt_text= "insert into t1 (id, name) values (?, ?)";
13979
13979
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
13980
13980
check_execute(stmt, rc);
13981
bzero((char*) my_bind, sizeof(my_bind));
13981
memset((char*) my_bind, 0, sizeof(my_bind));
13982
13982
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
13983
13983
my_bind[0].buffer= (void*) &id_val;
13984
13984
my_bind[1].buffer_type= MYSQL_TYPE_STRING;
14000
14000
mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type);
14001
14001
stmt1= mysql_stmt_init(mysql);
14002
14002
mysql_stmt_attr_set(stmt1, STMT_ATTR_CURSOR_TYPE, (const void*) &type);
14003
bzero((char*) my_bind, sizeof(my_bind));
14003
memset((char*) my_bind, 0, sizeof(my_bind));
14004
14004
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
14005
14005
my_bind[0].buffer= (void*) a;
14006
14006
my_bind[0].buffer_length= sizeof(a);
14073
14073
type= (ulong) CURSOR_TYPE_READ_ONLY;
14074
14074
mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type);
14076
bzero((char*) bind_in, sizeof(bind_in));
14077
bzero((char*) bind_out, sizeof(bind_out));
14078
bzero((char*) &hired, sizeof(hired));
14076
memset((char*) bind_in, 0, sizeof(bind_in));
14077
memset((char*) bind_out, 0, sizeof(bind_out));
14078
memset((char*) &hired, 0, sizeof(hired));
14079
14079
hired.year= 1965;
14080
14080
hired.month= 1;
14081
14081
hired.day= 1;
14144
14144
type= (ulong) CURSOR_TYPE_READ_ONLY;
14145
14145
mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type);
14147
bzero((char*) my_bind, sizeof(my_bind));
14147
memset((char*) my_bind, 0, sizeof(my_bind));
14148
14148
strmov(buf[0], "pcint502_MY2");
14149
14149
strmov(buf[1], "*");
14150
14150
for (i=0; i < 2; i++)
14409
14409
rc= mysql_query(mysql, "alter table t1 engine=InnoDB");
14412
bzero(my_bind, sizeof(my_bind));
14412
memset(my_bind, 0, sizeof(my_bind));
14413
14413
my_bind[0].buffer_type= MYSQL_TYPE_STRING;
14414
14414
my_bind[0].buffer= (void*) id_buf;
14415
14415
my_bind[0].buffer_length= sizeof(id_buf);
14532
14532
stmt1= open_cursor("SELECT empno, firstname, midinit, lastname,"
14533
14533
"workdept, salary, bonus FROM t1");
14535
bzero(my_bind, sizeof(my_bind));
14535
memset(my_bind, 0, sizeof(my_bind));
14536
14536
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
14537
14537
my_bind[0].buffer= (void*) &empno;
14704
14704
" from (t1 left join t2 on t2.deptno = t1.workdept) "
14705
14705
" where t1.empno = ?) "
14706
14706
"order by 1");
14707
bzero(my_bind, sizeof(my_bind));
14707
memset(my_bind, 0, sizeof(my_bind));
14709
14709
my_bind[0].buffer_type= MYSQL_TYPE_LONG;
14710
14710
my_bind[0].buffer= &empno;
15606
15606
DIE_UNLESS(res == 0);
15607
15607
rc= mysql_query(mysql, "drop table t2");
15610
15610
rc= mysql_query(mysql, "insert into t1 select null,'d'");
15612
15612
res= mysql_insert_id(mysql);
17797
17797
struct my_tests_st *fptr;
17799
17799
printf("All possible test names:\n\n");
17800
17800
for (fptr= my_tests; fptr->name; fptr++)
17801
17801
printf("%s\n", fptr->name);