Skip to content

Commit 3ecbb5a

Browse files
wl#2936 - fixing problems
1 parent 48f3ec8 commit 3ecbb5a

20 files changed

Lines changed: 369 additions & 365 deletions

include/mysql/plugin.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,8 +632,8 @@ struct st_mysql_value
632632
{
633633
int (*value_type)(struct st_mysql_value *);
634634
const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
635-
int (*val_real)(struct st_mysql_value *, void *realbuf, int realsize);
636-
int (*val_int)(struct st_mysql_value *, void *intbuf, int intsize);
635+
int (*val_real)(struct st_mysql_value *, double *realbuf);
636+
int (*val_int)(struct st_mysql_value *, long long *intbuf);
637637
};
638638

639639

@@ -651,8 +651,8 @@ long long thd_test_options(const MYSQL_THD thd, long long test_options);
651651
int thd_sql_command(const MYSQL_THD thd);
652652
const char *thd_proc_info(MYSQL_THD thd, const char *info);
653653
void **thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton);
654-
char *thd_security_context(MYSQL_THD thd, char *buffer, int length,
655-
int max_query_len);
654+
char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length,
655+
unsigned int max_query_len);
656656

657657

658658
#ifdef __cplusplus

mysql-test/mysql-test-run.pl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2930,8 +2930,8 @@ ($$)
29302930
mtr_add_arg($args, "--skip-grant-tables");
29312931
mtr_add_arg($args, "--basedir=%s", $path_my_basedir);
29322932
mtr_add_arg($args, "--datadir=%s", $data_dir);
2933-
mtr_add_arg($args, "--skip-innodb");
2934-
mtr_add_arg($args, "--skip-ndbcluster");
2933+
mtr_add_arg($args, "--loose-skip-innodb");
2934+
mtr_add_arg($args, "--loose-skip-ndbcluster");
29352935
mtr_add_arg($args, "--tmpdir=.");
29362936
mtr_add_arg($args, "--core-file");
29372937

@@ -3037,8 +3037,8 @@ ($)
30373037
basedir = $path_my_basedir
30383038
server_id = $server_id
30393039
skip-stack-trace
3040-
skip-innodb
3041-
skip-ndbcluster
3040+
loose-skip-innodb
3041+
loose-skip-ndbcluster
30423042
EOF
30433043
;
30443044
if ( $mysql_version_id < 50100 )
@@ -3676,7 +3676,7 @@ ($$$$$)
36763676
if ( $opt_skip_ndbcluster ||
36773677
!$cluster->{'pid'})
36783678
{
3679-
mtr_add_arg($args, "%s--skip-ndbcluster", $prefix);
3679+
mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
36803680
}
36813681
else
36823682
{
@@ -3731,7 +3731,7 @@ ($$$$$)
37313731
$slave->[$idx]->{'port'});
37323732
mtr_add_arg($args, "%s--report-user=root", $prefix);
37333733
mtr_add_arg($args, "%s--skip-innodb", $prefix);
3734-
mtr_add_arg($args, "%s--skip-ndbcluster", $prefix);
3734+
mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
37353735
mtr_add_arg($args, "%s--skip-slave-start", $prefix);
37363736

37373737
# Directory where slaves find the dumps generated by "load data"
@@ -3767,7 +3767,7 @@ ($$$$$)
37673767
$slave->[$idx]->{'cluster'} == -1 ||
37683768
!$clusters->[$slave->[$idx]->{'cluster'}]->{'pid'} )
37693769
{
3770-
mtr_add_arg($args, "%s--skip-ndbcluster", $prefix);
3770+
mtr_add_arg($args, "%s--loose-skip-ndbcluster", $prefix);
37713771
}
37723772
else
37733773
{

mysql-test/r/flush2.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Variable_name Value
55
log ON
66
log_bin OFF
77
log_bin_trust_function_creators ON
8+
log_bin_trust_routine_creators ON
89
log_error
910
log_output TABLE
1011
log_queries_not_using_indexes OFF
@@ -17,6 +18,7 @@ Variable_name Value
1718
log ON
1819
log_bin OFF
1920
log_bin_trust_function_creators ON
21+
log_bin_trust_routine_creators ON
2022
log_error
2123
log_output TABLE
2224
log_queries_not_using_indexes OFF

mysql-test/r/im_utils.result

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ character-sets-dir VALUE
2020
basedir VALUE
2121
server_id VALUE
2222
skip-stack-trace VALUE
23-
skip-plugin-innodb VALUE
24-
skip-plugin-ndbcluster VALUE
23+
loose-skip-innodb VALUE
24+
loose-skip-ndbcluster VALUE
2525
log-output VALUE
2626
SHOW INSTANCE OPTIONS mysqld2;
2727
option_name value
@@ -38,8 +38,8 @@ character-sets-dir VALUE
3838
basedir VALUE
3939
server_id VALUE
4040
skip-stack-trace VALUE
41-
skip-plugin-innodb VALUE
42-
skip-plugin-ndbcluster VALUE
41+
loose-skip-innodb VALUE
42+
loose-skip-ndbcluster VALUE
4343
nonguarded VALUE
4444
log-output VALUE
4545
START INSTANCE mysqld2;

mysys/my_getopt.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,18 @@ void my_getopt_register_get_addr(gptr* (*func_addr)(const char *, uint,
9797
getopt_get_addr= func_addr;
9898
}
9999

100-
int handle_options(int *argc, char ***argv,
100+
int handle_options(int *argc, char ***argv,
101101
const struct my_option *longopts,
102102
my_get_one_option get_one_option)
103103
{
104-
uint opt_found, argvpos= 0, length, i;
104+
uint opt_found, argvpos= 0, length;
105105
my_bool end_of_options= 0, must_be_var, set_maximum_value,
106106
option_is_loose;
107107
char **pos, **pos_end, *optend, *prev_found,
108108
*opt_str, key_name[FN_REFLEN];
109109
const struct my_option *optp;
110110
gptr *value;
111-
int error;
111+
int error, i;
112112

113113
LINT_INIT(opt_found);
114114
(*argc)--; /* Skip the program name */
@@ -224,12 +224,11 @@ int handle_options(int *argc, char ***argv,
224224
/*
225225
We were called with a special prefix, we can reuse opt_found
226226
*/
227-
opt_str+= (special_opt_prefix_lengths[i] + 1);
227+
opt_str+= special_opt_prefix_lengths[i] + 1;
228+
length-= special_opt_prefix_lengths[i] + 1;
228229
if (i == OPT_LOOSE)
229230
option_is_loose= 1;
230-
if ((opt_found= findopt(opt_str, length -
231-
(special_opt_prefix_lengths[i] + 1),
232-
&optp, &prev_found)))
231+
if ((opt_found= findopt(opt_str, length, &optp, &prev_found)))
233232
{
234233
if (opt_found > 1)
235234
{
@@ -253,7 +252,7 @@ int handle_options(int *argc, char ***argv,
253252
break;
254253
case OPT_ENABLE:
255254
optend= (optend && *optend == '0' && !(*(optend + 1))) ?
256-
disabled_my_option : (char*) "1";
255+
disabled_my_option : (char*) "1";
257256
break;
258257
case OPT_MAXIMUM:
259258
set_maximum_value= 1;
@@ -262,6 +261,7 @@ int handle_options(int *argc, char ***argv,
262261
}
263262
break; /* break from the inner loop, main loop continues */
264263
}
264+
i= -1; /* restart the loop */
265265
}
266266
}
267267
}

sql/event_queue.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ event_queue_element_compare_q(void *vptr, byte* a, byte *b)
7979
*/
8080

8181
Event_queue::Event_queue()
82-
:mutex_last_unlocked_at_line(0), mutex_last_locked_at_line(0),
82+
:mutex_last_locked_at_line(0), mutex_last_unlocked_at_line(0),
8383
mutex_last_attempted_lock_at_line(0),
8484
mutex_queue_data_locked(FALSE), mutex_queue_data_attempting_lock(FALSE)
8585
{

sql/handler.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,6 +1508,7 @@ void **handler::ha_data(void) const
15081508

15091509
THD *handler::ha_thd(void) const
15101510
{
1511+
DBUG_ASSERT(!table || !table->in_use || table->in_use == current_thd);
15111512
return (table && table->in_use) ? table->in_use : current_thd;
15121513
}
15131514

sql/handler.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,6 +1516,10 @@ class handler :public Sql_alloc
15161516

15171517
/* lock_count() can be more than one if the table is a MERGE */
15181518
virtual uint lock_count(void) const { return 1; }
1519+
/*
1520+
NOTE that one can NOT rely on table->in_use in store_lock(). It may
1521+
refer to a different thread if called from mysql_lock_abort_for_thread().
1522+
*/
15191523
virtual THR_LOCK_DATA **store_lock(THD *thd,
15201524
THR_LOCK_DATA **to,
15211525
enum thr_lock_type lock_type)=0;

0 commit comments

Comments
 (0)