Fixed compiler and valgrind warnings
Added missing DBUG_xxx_RETURN statements Fixed some usage of not initialized variables (as found by valgrind) Ensure that we don't remove locked tables used as name locks from open table cache until unlock_table_names() are called. This was fixed by having drop_locked_name() returning any table used as a name lock so that we can free it in unlock_table_names() This will allow Tomas to continue with his work to use namelocks to syncronize things. Note: valgrind still produces a lot of warnings about using not initialized code and shows memory loss errors when running the ndb tests BitKeeper/etc/ignore: added mysql-test/r/*.log client/mysqltest.c: Change type of variables to get rid of compiler warnings More debugging Fix memory leak mysql-test/mysql-test-run.sh: Collect warnings about missing DBUG_RETURN statements mysql-test/r/lock_multi.result: Add test of new code mysql-test/r/ndb_condition_pushdown.result: Drop used tables before test mysql-test/t/lock_multi.test: Add test of new code mysql-test/t/ndb_condition_pushdown.test: Drop used tables before test mysql-test/valgrind.supp: Ignore 'safe' warnings from libz (when used with archive) sql/event.cc: More comments Simplify code Fixed memory leak found by valgrind sql/ha_archive.cc: Remove compiler warnings (Wrong handlerton structure and signed/unsigned comparison) sql/ha_berkeley.cc: Fixed compiler warning sql/ha_blackhole.cc: Fixed compiler warning sql/ha_federated.cc: Fixed compiler warning sql/ha_heap.cc: Fixed compiler warning sql/ha_myisam.cc: Fixed compiler warning sql/ha_myisammrg.cc: Fixed compiler warning sql/ha_ndbcluster.cc: Fixed compiler warnings sql/ha_partition.cc: Fixed compiler warning Fixed error noticed by valgrind in ha_partition::rnd_init() sql/handler.cc: Fixed compiler warning sql/handler.h: Fixed compiler warning sql/item.cc: Fixed compiler warning sql/item_xmlfunc.cc: Fixed warning from valgrind when calling memcpy with wrong address sql/lock.cc: More debugging sql/log.cc: Fixed compiler warning Indentation fixes sql/log.h: Fixed compiler warning sql/mysql_priv.h: Changed prototype for 'drop_locked_tables' sql/opt_range.cc: Indentation fix sql/password.c: Removed compiler warnings sql/set_var.cc: Fixed compiler warning sql/slave.cc: Fixed compiler warning sql/sp_head.cc: Fixed compiler warning sql/sql_acl.cc: Fixed compiler warning sql/sql_analyse.cc: Added missing DBUG_RETURN statements sql/sql_base.cc: Removed de-reference of not initialized pointer More comments drop_locked_tables() changed to not delete tables used for name locking Fixed compiler warnings sql/sql_delete.cc: Fixed usage of not initialized variable (deleted could be referenced in some not common error conditions) sql/sql_parse.cc: Added missing DBUG_VOID_RETURN Simplify code sql/sql_partition.cc: Fixed usage of wrong variable (noticed by valgrind) sql/sql_plugin.cc: Removed compiler warning sql/sql_show.cc: Removed compiler warning sql/sql_table.cc: Ensure that we don't remove locked tables used as name locks from open table cache until unlock_table_names() are called. This was fixed by having drop_locked_name() returning any table used as a name lock so that we can free it in unlock_table_names() This will allow Tomas to continue with his work to use namelocks to syncronize things. Fixed wrong test of 'table_type' (path_length could otherwise be accessed uninitialized) Remove compile warnings about not initialized variables. sql/sql_yacc.yy: Ensure that no_write_to_binlog is properly initialized (Was accessed uninitialized by partition code) sql/table.cc: Removed valgrind warnings (not fatal) Removed compiler warnings sql/tztime.cc: Removed valgrind warning storage/ndb/include/ndbapi/NdbIndexStat.hpp: Removed compiler warning
This commit is contained in:
parent
73970addd8
commit
59eaf292de
@ -1758,3 +1758,4 @@ vio/viotest-sslconnect.cpp
|
|||||||
vio/viotest.cpp
|
vio/viotest.cpp
|
||||||
zlib/*.ds?
|
zlib/*.ds?
|
||||||
zlib/*.vcproj
|
zlib/*.vcproj
|
||||||
|
mysql-test/r/*.log
|
||||||
|
@ -209,9 +209,9 @@ struct st_replace_regex
|
|||||||
*/
|
*/
|
||||||
char* buf;
|
char* buf;
|
||||||
char* even_buf;
|
char* even_buf;
|
||||||
uint even_buf_len;
|
|
||||||
char* odd_buf;
|
char* odd_buf;
|
||||||
uint odd_buf_len;
|
int even_buf_len;
|
||||||
|
int odd_buf_len;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct st_replace_regex *glob_replace_regex= 0;
|
struct st_replace_regex *glob_replace_regex= 0;
|
||||||
@ -1279,6 +1279,7 @@ int var_query_set(VAR* var, const char *query, const char** query_end)
|
|||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
MYSQL* mysql = &cur_con->mysql;
|
MYSQL* mysql = &cur_con->mysql;
|
||||||
LINT_INIT(res);
|
LINT_INIT(res);
|
||||||
|
DBUG_ENTER("var_query_set");
|
||||||
|
|
||||||
while (end > query && *end != '`')
|
while (end > query && *end != '`')
|
||||||
--end;
|
--end;
|
||||||
@ -1340,7 +1341,7 @@ int var_query_set(VAR* var, const char *query, const char** query_end)
|
|||||||
eval_expr(var, "", 0);
|
eval_expr(var, "", 0);
|
||||||
|
|
||||||
mysql_free_result(res);
|
mysql_free_result(res);
|
||||||
return 0;
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void var_copy(VAR *dest, VAR *src)
|
void var_copy(VAR *dest, VAR *src)
|
||||||
@ -1517,6 +1518,7 @@ void do_system(struct st_query *command)
|
|||||||
}
|
}
|
||||||
|
|
||||||
command->last_argument= command->end;
|
command->last_argument= command->end;
|
||||||
|
dynstr_free(&ds_cmd);
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1557,7 +1559,7 @@ int do_echo(struct st_query *command)
|
|||||||
dynstr_append_mem(ds, "\n", 1);
|
dynstr_append_mem(ds, "\n", 1);
|
||||||
dynstr_free(&ds_echo);
|
dynstr_free(&ds_echo);
|
||||||
command->last_argument= command->end;
|
command->last_argument= command->end;
|
||||||
return 0;
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1660,7 +1662,7 @@ int do_save_master_pos()
|
|||||||
|
|
||||||
if (have_ndbcluster)
|
if (have_ndbcluster)
|
||||||
{
|
{
|
||||||
ulonglong epoch, tmp_epoch= 0;
|
ulonglong epoch=0, tmp_epoch= 0;
|
||||||
int count= 0;
|
int count= 0;
|
||||||
|
|
||||||
do
|
do
|
||||||
|
@ -1088,7 +1088,7 @@ report_stats () {
|
|||||||
|
|
||||||
found_error=0
|
found_error=0
|
||||||
# Find errors
|
# Find errors
|
||||||
for i in "^Warning:" "^Error:" "^==.* at 0x" "InnoDB: Warning"
|
for i in "^Warning:" "^Error:" "^==.* at 0x" "InnoDB: Warning" "missing DBUG_RETURN"
|
||||||
do
|
do
|
||||||
if $GREP "$i" $MY_LOG_DIR/warnings.tmp >> $MY_LOG_DIR/warnings
|
if $GREP "$i" $MY_LOG_DIR/warnings.tmp >> $MY_LOG_DIR/warnings
|
||||||
then
|
then
|
||||||
|
@ -36,6 +36,13 @@ lock table t1 write, t2 write;
|
|||||||
drop table t2;
|
drop table t2;
|
||||||
ERROR 42S02: Table 'test.t2' doesn't exist
|
ERROR 42S02: Table 'test.t2' doesn't exist
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 (a int);
|
||||||
|
create table t2 (a int);
|
||||||
|
lock table t1 write, t2 write, t1 as t1_2 write, t2 as t2_2 write;
|
||||||
|
insert t1 select * from t2;
|
||||||
|
drop table t2;
|
||||||
|
ERROR 42S02: Table 'test.t2' doesn't exist
|
||||||
|
drop table t1;
|
||||||
create table t1(a int);
|
create table t1(a int);
|
||||||
lock tables t1 write;
|
lock tables t1 write;
|
||||||
show columns from t1;
|
show columns from t1;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
DROP TABLE IF EXISTS t1,t2;
|
DROP TABLE IF EXISTS t1,t2,t3,t4;
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
auto int(5) unsigned NOT NULL auto_increment,
|
auto int(5) unsigned NOT NULL auto_increment,
|
||||||
string char(10),
|
string char(10),
|
||||||
|
@ -95,6 +95,25 @@ reap;
|
|||||||
connection locker;
|
connection locker;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Same test as above, but with the dropped table locked twice
|
||||||
|
#
|
||||||
|
|
||||||
|
connection locker;
|
||||||
|
create table t1 (a int);
|
||||||
|
create table t2 (a int);
|
||||||
|
lock table t1 write, t2 write, t1 as t1_2 write, t2 as t2_2 write;
|
||||||
|
connection reader;
|
||||||
|
send insert t1 select * from t2;
|
||||||
|
connection locker;
|
||||||
|
drop table t2;
|
||||||
|
connection reader;
|
||||||
|
--error 1146
|
||||||
|
reap;
|
||||||
|
connection locker;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
-- source include/not_embedded.inc
|
-- source include/not_embedded.inc
|
||||||
|
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
DROP TABLE IF EXISTS t1,t2;
|
DROP TABLE IF EXISTS t1,t2,t3,t4;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -153,6 +153,15 @@
|
|||||||
fun:gzflush
|
fun:gzflush
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
libz deflate3
|
||||||
|
Memcheck:Cond
|
||||||
|
obj:*/libz.so.*
|
||||||
|
obj:*/libz.so.*
|
||||||
|
fun:deflate
|
||||||
|
fun:do_flush
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Warning from my_thread_init becasue mysqld dies before kill thread exists
|
# Warning from my_thread_init becasue mysqld dies before kill thread exists
|
||||||
#
|
#
|
||||||
|
21
sql/event.cc
21
sql/event.cc
@ -952,6 +952,10 @@ err:
|
|||||||
NOTES
|
NOTES
|
||||||
1) Use sp_name for look up, return in **ett if found
|
1) Use sp_name for look up, return in **ett if found
|
||||||
2) tbl is not closed at exit
|
2) tbl is not closed at exit
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
0 ok In this case *ett is set to the event
|
||||||
|
# error *ett == 0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -960,7 +964,7 @@ db_find_event(THD *thd, sp_name *name, LEX_STRING *definer, Event_timed **ett,
|
|||||||
{
|
{
|
||||||
TABLE *table;
|
TABLE *table;
|
||||||
int ret;
|
int ret;
|
||||||
Event_timed *et=NULL;
|
Event_timed *et= 0;
|
||||||
DBUG_ENTER("db_find_event");
|
DBUG_ENTER("db_find_event");
|
||||||
DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
|
DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
|
||||||
|
|
||||||
@ -997,7 +1001,7 @@ db_find_event(THD *thd, sp_name *name, LEX_STRING *definer, Event_timed **ett,
|
|||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (ret && et)
|
if (ret)
|
||||||
{
|
{
|
||||||
delete et;
|
delete et;
|
||||||
et= 0;
|
et= 0;
|
||||||
@ -1382,7 +1386,7 @@ evex_show_create_event(THD *thd, sp_name *spn, LEX_STRING definer)
|
|||||||
ret= db_find_event(thd, spn, &definer, &et, NULL, thd->mem_root);
|
ret= db_find_event(thd, spn, &definer, &et, NULL, thd->mem_root);
|
||||||
thd->restore_backup_open_tables_state(&backup);
|
thd->restore_backup_open_tables_state(&backup);
|
||||||
|
|
||||||
if (!ret && et)
|
if (et)
|
||||||
{
|
{
|
||||||
Protocol *protocol= thd->protocol;
|
Protocol *protocol= thd->protocol;
|
||||||
char show_str_buf[768];
|
char show_str_buf[768];
|
||||||
@ -1392,10 +1396,12 @@ evex_show_create_event(THD *thd, sp_name *spn, LEX_STRING definer)
|
|||||||
ulong sql_mode_len=0;
|
ulong sql_mode_len=0;
|
||||||
|
|
||||||
show_str.length(0);
|
show_str.length(0);
|
||||||
show_str.set_charset(system_charset_info);
|
|
||||||
|
|
||||||
if (et->get_create_event(thd, &show_str))
|
if (et->get_create_event(thd, &show_str))
|
||||||
|
{
|
||||||
|
delete et;
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
|
}
|
||||||
|
|
||||||
field_list.push_back(new Item_empty_string("Event", NAME_LEN));
|
field_list.push_back(new Item_empty_string("Event", NAME_LEN));
|
||||||
|
|
||||||
@ -1409,16 +1415,19 @@ evex_show_create_event(THD *thd, sp_name *spn, LEX_STRING definer)
|
|||||||
show_str.length()));
|
show_str.length()));
|
||||||
if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS |
|
if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS |
|
||||||
Protocol::SEND_EOF))
|
Protocol::SEND_EOF))
|
||||||
|
{
|
||||||
|
delete et;
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
|
}
|
||||||
protocol->prepare_for_resend();
|
protocol->prepare_for_resend();
|
||||||
protocol->store(et->name.str, et->name.length, system_charset_info);
|
protocol->store(et->name.str, et->name.length, system_charset_info);
|
||||||
|
|
||||||
protocol->store((char*) sql_mode_str, sql_mode_len, system_charset_info);
|
protocol->store((char*) sql_mode_str, sql_mode_len, system_charset_info);
|
||||||
|
|
||||||
protocol->store(show_str.c_ptr(), show_str.length(), system_charset_info);
|
protocol->store(show_str.ptr(), show_str.length(), system_charset_info);
|
||||||
ret= protocol->write();
|
ret= protocol->write();
|
||||||
send_eof(thd);
|
send_eof(thd);
|
||||||
|
delete et;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBUG_RETURN(ret);
|
DBUG_RETURN(ret);
|
||||||
|
@ -180,7 +180,9 @@ handlerton archive_hton = {
|
|||||||
NULL, /* fill_files_table */
|
NULL, /* fill_files_table */
|
||||||
HTON_NO_FLAGS,
|
HTON_NO_FLAGS,
|
||||||
NULL, /* binlog_func */
|
NULL, /* binlog_func */
|
||||||
NULL /* binlog_log_query */
|
NULL, /* binlog_log_query */
|
||||||
|
NULL /* release_temporary_latches */
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static handler *archive_create_handler(TABLE_SHARE *table)
|
static handler *archive_create_handler(TABLE_SHARE *table)
|
||||||
@ -1228,10 +1230,11 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt)
|
|||||||
if (table->found_next_number_field)
|
if (table->found_next_number_field)
|
||||||
{
|
{
|
||||||
Field *field= table->found_next_number_field;
|
Field *field= table->found_next_number_field;
|
||||||
if (share->auto_increment_value <
|
ulonglong auto_value=
|
||||||
field->val_int((char*)(buf + field->offset())))
|
(ulonglong) field->val_int((char*)(buf + field->offset()));
|
||||||
|
if (share->auto_increment_value < auto_value)
|
||||||
auto_increment_value= share->auto_increment_value=
|
auto_increment_value= share->auto_increment_value=
|
||||||
field->val_int((char*)(buf + field->offset()));
|
auto_value;
|
||||||
}
|
}
|
||||||
share->rows_recorded++;
|
share->rows_recorded++;
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,8 @@ handlerton berkeley_hton = {
|
|||||||
NULL, /* Fill Files Table */
|
NULL, /* Fill Files Table */
|
||||||
HTON_CLOSE_CURSORS_AT_COMMIT | HTON_FLUSH_AFTER_RENAME,
|
HTON_CLOSE_CURSORS_AT_COMMIT | HTON_FLUSH_AFTER_RENAME,
|
||||||
NULL, /* binlog_func */
|
NULL, /* binlog_func */
|
||||||
NULL /* binlog_log_query */
|
NULL, /* binlog_log_query */
|
||||||
|
NULL /* release_temporary_latches */
|
||||||
};
|
};
|
||||||
|
|
||||||
handler *berkeley_create_handler(TABLE_SHARE *table)
|
handler *berkeley_create_handler(TABLE_SHARE *table)
|
||||||
|
@ -62,8 +62,9 @@ handlerton blackhole_hton= {
|
|||||||
NULL, /* Alter Tablespace */
|
NULL, /* Alter Tablespace */
|
||||||
NULL, /* Fill FILES table */
|
NULL, /* Fill FILES table */
|
||||||
HTON_CAN_RECREATE,
|
HTON_CAN_RECREATE,
|
||||||
NULL, /* binlog_func */
|
NULL, /* binlog_func */
|
||||||
NULL /* binlog_log_query */
|
NULL, /* binlog_log_query */
|
||||||
|
NULL /* release_temporary_latches */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -400,7 +400,8 @@ handlerton federated_hton= {
|
|||||||
NULL, /* Fill FILES table */
|
NULL, /* Fill FILES table */
|
||||||
HTON_ALTER_NOT_SUPPORTED,
|
HTON_ALTER_NOT_SUPPORTED,
|
||||||
NULL, /* binlog_func */
|
NULL, /* binlog_func */
|
||||||
NULL /* binlog_log_query */
|
NULL, /* binlog_log_query */
|
||||||
|
NULL /* release_temporary_latches */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,7 +60,8 @@ handlerton heap_hton= {
|
|||||||
NULL, /* Fill Files Table */
|
NULL, /* Fill Files Table */
|
||||||
HTON_CAN_RECREATE,
|
HTON_CAN_RECREATE,
|
||||||
NULL, /* binlog_func */
|
NULL, /* binlog_func */
|
||||||
NULL /* binlog_log_query */
|
NULL, /* binlog_log_query */
|
||||||
|
NULL /* release_temporary_latches */
|
||||||
};
|
};
|
||||||
|
|
||||||
static handler *heap_create_handler(TABLE_SHARE *table)
|
static handler *heap_create_handler(TABLE_SHARE *table)
|
||||||
|
@ -92,7 +92,8 @@ handlerton myisam_hton= {
|
|||||||
NULL, /* Fill Files Table */
|
NULL, /* Fill Files Table */
|
||||||
HTON_CAN_RECREATE,
|
HTON_CAN_RECREATE,
|
||||||
NULL, /* binlog_func */
|
NULL, /* binlog_func */
|
||||||
NULL /* binlog_log_query */
|
NULL, /* binlog_log_query */
|
||||||
|
NULL /* release_temporary_latches */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,7 +70,8 @@ handlerton myisammrg_hton= {
|
|||||||
NULL, /* Fill Files Table */
|
NULL, /* Fill Files Table */
|
||||||
HTON_CAN_RECREATE,
|
HTON_CAN_RECREATE,
|
||||||
NULL, /* binlog_func */
|
NULL, /* binlog_func */
|
||||||
NULL /* binlog_log_query */
|
NULL, /* binlog_log_query */
|
||||||
|
NULL /* release_temporary_latches */
|
||||||
};
|
};
|
||||||
|
|
||||||
static handler *myisammrg_create_handler(TABLE_SHARE *table)
|
static handler *myisammrg_create_handler(TABLE_SHARE *table)
|
||||||
|
@ -2336,7 +2336,7 @@ int ha_ndbcluster::ordered_index_scan(const key_range *start_key,
|
|||||||
if (generate_scan_filter(m_cond_stack, op))
|
if (generate_scan_filter(m_cond_stack, op))
|
||||||
DBUG_RETURN(ndb_err(trans));
|
DBUG_RETURN(ndb_err(trans));
|
||||||
|
|
||||||
if (res= define_read_attrs(buf, op))
|
if ((res= define_read_attrs(buf, op)))
|
||||||
{
|
{
|
||||||
DBUG_RETURN(res);
|
DBUG_RETURN(res);
|
||||||
}
|
}
|
||||||
@ -9681,6 +9681,7 @@ int ndbcluster_alter_tablespace(THD* thd, st_alter_tablespace *info)
|
|||||||
NDBDICT *dict = ndb->getDictionary();
|
NDBDICT *dict = ndb->getDictionary();
|
||||||
int error;
|
int error;
|
||||||
const char * errmsg;
|
const char * errmsg;
|
||||||
|
LINT_INIT(errmsg);
|
||||||
|
|
||||||
switch (info->ts_cmd_type){
|
switch (info->ts_cmd_type){
|
||||||
case (CREATE_TABLESPACE):
|
case (CREATE_TABLESPACE):
|
||||||
|
@ -103,8 +103,9 @@ handlerton partition_hton = {
|
|||||||
NULL, /* Alter Tablespace */
|
NULL, /* Alter Tablespace */
|
||||||
NULL, /* Fill FILES table */
|
NULL, /* Fill FILES table */
|
||||||
HTON_NOT_USER_SELECTABLE | HTON_HIDDEN,
|
HTON_NOT_USER_SELECTABLE | HTON_HIDDEN,
|
||||||
NULL, /* binlog_func */
|
NULL, /* binlog_func */
|
||||||
NULL /* binlog_log_query */
|
NULL, /* binlog_log_query */
|
||||||
|
NULL /* release_temporary_latches */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2914,12 +2915,15 @@ int ha_partition::rnd_init(bool scan)
|
|||||||
|
|
||||||
/* Now we see what the index of our first important partition is */
|
/* Now we see what the index of our first important partition is */
|
||||||
DBUG_PRINT("info", ("m_part_info->used_partitions 0x%x",
|
DBUG_PRINT("info", ("m_part_info->used_partitions 0x%x",
|
||||||
m_part_info->used_partitions.bitmap));
|
m_part_info->used_partitions.bitmap));
|
||||||
part_id= bitmap_get_first_set(&(m_part_info->used_partitions));
|
part_id= bitmap_get_first_set(&(m_part_info->used_partitions));
|
||||||
DBUG_PRINT("info", ("m_part_spec.start_part %d", part_id));
|
DBUG_PRINT("info", ("m_part_spec.start_part %d", part_id));
|
||||||
|
|
||||||
if (MY_BIT_NONE == part_id)
|
if (MY_BIT_NONE == part_id)
|
||||||
|
{
|
||||||
|
error= 0;
|
||||||
goto err1;
|
goto err1;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
We have a partition and we are scanning with rnd_next
|
We have a partition and we are scanning with rnd_next
|
||||||
@ -2958,7 +2962,7 @@ err:
|
|||||||
while ((int)--i >= (int)part_id)
|
while ((int)--i >= (int)part_id)
|
||||||
{
|
{
|
||||||
if (bitmap_is_set(&(m_part_info->used_partitions), i))
|
if (bitmap_is_set(&(m_part_info->used_partitions), i))
|
||||||
m_file[i]->ha_rnd_end();
|
m_file[i]->ha_rnd_end();
|
||||||
}
|
}
|
||||||
err1:
|
err1:
|
||||||
m_scan_value= 2;
|
m_scan_value= 2;
|
||||||
|
@ -68,7 +68,8 @@ const handlerton default_hton =
|
|||||||
NULL, /* fill_files_table */
|
NULL, /* fill_files_table */
|
||||||
HTON_NO_FLAGS, /* flags */
|
HTON_NO_FLAGS, /* flags */
|
||||||
NULL, /* binlog_func */
|
NULL, /* binlog_func */
|
||||||
NULL /* binlog_log_query */
|
NULL, /* binlog_log_query */
|
||||||
|
NULL /* release_temporary_latches */
|
||||||
};
|
};
|
||||||
|
|
||||||
static SHOW_COMP_OPTION have_yes= SHOW_OPTION_YES;
|
static SHOW_COMP_OPTION have_yes= SHOW_OPTION_YES;
|
||||||
|
@ -686,6 +686,8 @@ public:
|
|||||||
{
|
{
|
||||||
do_prelock(tables, count);
|
do_prelock(tables, count);
|
||||||
}
|
}
|
||||||
|
virtual ~TABLEOP_HOOKS() {}
|
||||||
|
TABLEOP_HOOKS() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/* Function primitive that is called prior to locking tables */
|
/* Function primitive that is called prior to locking tables */
|
||||||
|
@ -1362,6 +1362,9 @@ bool agg_item_charsets(DTCollation &coll, const char *fname,
|
|||||||
Item **args, uint nargs, uint flags)
|
Item **args, uint nargs, uint flags)
|
||||||
{
|
{
|
||||||
Item **arg, **last, *safe_args[2];
|
Item **arg, **last, *safe_args[2];
|
||||||
|
|
||||||
|
LINT_INIT(safe_args[0]);
|
||||||
|
LINT_INIT(safe_args[1]);
|
||||||
if (agg_item_collations(coll, fname, args, nargs, flags))
|
if (agg_item_collations(coll, fname, args, nargs, flags))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
@ -2403,8 +2403,7 @@ void Item_xml_str_func::fix_length_and_dec()
|
|||||||
char context[32];
|
char context[32];
|
||||||
uint clen= xpath.query.end - xpath.lasttok.beg;
|
uint clen= xpath.query.end - xpath.lasttok.beg;
|
||||||
set_if_bigger(clen, sizeof(context) - 1);
|
set_if_bigger(clen, sizeof(context) - 1);
|
||||||
memcpy(context, xpath.lasttok.beg, clen);
|
strmake(context, xpath.lasttok.beg, clen);
|
||||||
context[clen]= '\0';
|
|
||||||
my_printf_error(ER_UNKNOWN_ERROR, "XPATH syntax error: '%s'",
|
my_printf_error(ER_UNKNOWN_ERROR, "XPATH syntax error: '%s'",
|
||||||
MYF(0), context);
|
MYF(0), context);
|
||||||
return;
|
return;
|
||||||
|
@ -911,11 +911,13 @@ end:
|
|||||||
void unlock_table_names(THD *thd, TABLE_LIST *table_list,
|
void unlock_table_names(THD *thd, TABLE_LIST *table_list,
|
||||||
TABLE_LIST *last_table)
|
TABLE_LIST *last_table)
|
||||||
{
|
{
|
||||||
|
DBUG_ENTER("unlock_table_names");
|
||||||
for (TABLE_LIST *table= table_list;
|
for (TABLE_LIST *table= table_list;
|
||||||
table != last_table;
|
table != last_table;
|
||||||
table= table->next_local)
|
table= table->next_local)
|
||||||
unlock_table_name(thd,table);
|
unlock_table_name(thd,table);
|
||||||
pthread_cond_broadcast(&COND_refresh);
|
pthread_cond_broadcast(&COND_refresh);
|
||||||
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
14
sql/log.cc
14
sql/log.cc
@ -63,9 +63,11 @@ static int binlog_prepare(THD *thd, bool all);
|
|||||||
Don't add constructors, destructors, or virtual functions.
|
Don't add constructors, destructors, or virtual functions.
|
||||||
*/
|
*/
|
||||||
struct binlog_trx_data {
|
struct binlog_trx_data {
|
||||||
bool empty() const {
|
bool empty() const
|
||||||
|
{
|
||||||
return pending == NULL && my_b_tell(&trans_log) == 0;
|
return pending == NULL && my_b_tell(&trans_log) == 0;
|
||||||
}
|
}
|
||||||
|
binlog_trx_data() {}
|
||||||
IO_CACHE trans_log; // The transaction cache
|
IO_CACHE trans_log; // The transaction cache
|
||||||
Rows_log_event *pending; // The pending binrows event
|
Rows_log_event *pending; // The pending binrows event
|
||||||
};
|
};
|
||||||
@ -104,7 +106,8 @@ handlerton binlog_hton = {
|
|||||||
NULL, /* Fill FILES table */
|
NULL, /* Fill FILES table */
|
||||||
HTON_NOT_USER_SELECTABLE | HTON_HIDDEN,
|
HTON_NOT_USER_SELECTABLE | HTON_HIDDEN,
|
||||||
NULL, /* binlog_func */
|
NULL, /* binlog_func */
|
||||||
NULL /* binlog_log_query */
|
NULL, /* binlog_log_query */
|
||||||
|
NULL /* release_temporary_latches */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -2637,8 +2640,9 @@ int THD::binlog_setup_trx_data()
|
|||||||
|
|
||||||
int THD::binlog_write_table_map(TABLE *table, bool is_trans)
|
int THD::binlog_write_table_map(TABLE *table, bool is_trans)
|
||||||
{
|
{
|
||||||
|
int error;
|
||||||
DBUG_ENTER("THD::binlog_write_table_map");
|
DBUG_ENTER("THD::binlog_write_table_map");
|
||||||
DBUG_PRINT("enter", ("table=%p (%s: #%u)",
|
DBUG_PRINT("enter", ("table: %p (%s: #%u)",
|
||||||
table, table->s->table_name, table->s->table_map_id));
|
table, table->s->table_name, table->s->table_map_id));
|
||||||
|
|
||||||
/* Pre-conditions */
|
/* Pre-conditions */
|
||||||
@ -2655,10 +2659,10 @@ int THD::binlog_write_table_map(TABLE *table, bool is_trans)
|
|||||||
trans_register_ha(this, options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN),
|
trans_register_ha(this, options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN),
|
||||||
&binlog_hton);
|
&binlog_hton);
|
||||||
|
|
||||||
if (int error= mysql_bin_log.write(&the_event))
|
if ((error= mysql_bin_log.write(&the_event)))
|
||||||
DBUG_RETURN(error);
|
DBUG_RETURN(error);
|
||||||
|
|
||||||
++binlog_table_maps;
|
binlog_table_maps++;
|
||||||
table->s->table_map_version= mysql_bin_log.table_map_version();
|
table->s->table_map_version= mysql_bin_log.table_map_version();
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,8 @@ class TC_LOG
|
|||||||
|
|
||||||
class TC_LOG_DUMMY: public TC_LOG // use it to disable the logging
|
class TC_LOG_DUMMY: public TC_LOG // use it to disable the logging
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
TC_LOG_DUMMY() {}
|
||||||
int open(const char *opt_name) { return 0; }
|
int open(const char *opt_name) { return 0; }
|
||||||
void close() { }
|
void close() { }
|
||||||
int log(THD *thd, my_xid xid) { return 1; }
|
int log(THD *thd, my_xid xid) { return 1; }
|
||||||
@ -354,6 +355,7 @@ public:
|
|||||||
class Log_event_handler
|
class Log_event_handler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Log_event_handler() {}
|
||||||
virtual bool init()= 0;
|
virtual bool init()= 0;
|
||||||
virtual void cleanup()= 0;
|
virtual void cleanup()= 0;
|
||||||
|
|
||||||
|
@ -838,7 +838,7 @@ bool reopen_tables(THD *thd,bool get_locks,bool in_refresh);
|
|||||||
bool close_data_tables(THD *thd,const char *db, const char *table_name);
|
bool close_data_tables(THD *thd,const char *db, const char *table_name);
|
||||||
bool wait_for_tables(THD *thd);
|
bool wait_for_tables(THD *thd);
|
||||||
bool table_is_used(TABLE *table, bool wait_for_name_lock);
|
bool table_is_used(TABLE *table, bool wait_for_name_lock);
|
||||||
bool drop_locked_tables(THD *thd,const char *db, const char *table_name);
|
TABLE *drop_locked_tables(THD *thd,const char *db, const char *table_name);
|
||||||
void abort_locked_tables(THD *thd,const char *db, const char *table_name);
|
void abort_locked_tables(THD *thd,const char *db, const char *table_name);
|
||||||
void execute_init_command(THD *thd, sys_var_str *init_command_var,
|
void execute_init_command(THD *thd, sys_var_str *init_command_var,
|
||||||
rw_lock_t *var_mutex);
|
rw_lock_t *var_mutex);
|
||||||
|
@ -6039,7 +6039,8 @@ SEL_ARG *
|
|||||||
SEL_ARG::insert(SEL_ARG *key)
|
SEL_ARG::insert(SEL_ARG *key)
|
||||||
{
|
{
|
||||||
SEL_ARG *element,**par,*last_element;
|
SEL_ARG *element,**par,*last_element;
|
||||||
LINT_INIT(par); LINT_INIT(last_element);
|
LINT_INIT(par);
|
||||||
|
LINT_INIT(last_element);
|
||||||
|
|
||||||
for (element= this; element != &null_element ; )
|
for (element= this; element != &null_element ; )
|
||||||
{
|
{
|
||||||
|
@ -323,7 +323,7 @@ void create_random_string(char *to, uint length, struct rand_struct *rand_st)
|
|||||||
|
|
||||||
char *octet2hex(char *to, const char *str, uint len)
|
char *octet2hex(char *to, const char *str, uint len)
|
||||||
{
|
{
|
||||||
const byte *str_end= str + len;
|
const char *str_end= str + len;
|
||||||
for (; str != str_end; ++str)
|
for (; str != str_end; ++str)
|
||||||
{
|
{
|
||||||
*to++= _dig_vec_upper[((uchar) *str) >> 4];
|
*to++= _dig_vec_upper[((uchar) *str) >> 4];
|
||||||
@ -406,7 +406,7 @@ make_scrambled_password(char *to, const char *password)
|
|||||||
mysql_sha1_result(&sha1_context, hash_stage2);
|
mysql_sha1_result(&sha1_context, hash_stage2);
|
||||||
/* convert hash_stage2 to hex string */
|
/* convert hash_stage2 to hex string */
|
||||||
*to++= PVERSION41_CHAR;
|
*to++= PVERSION41_CHAR;
|
||||||
octet2hex(to, hash_stage2, SHA1_HASH_SIZE);
|
octet2hex(to, (const char*) hash_stage2, SHA1_HASH_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -520,5 +520,5 @@ void get_salt_from_password(uint8 *hash_stage2, const char *password)
|
|||||||
void make_password_from_salt(char *to, const uint8 *hash_stage2)
|
void make_password_from_salt(char *to, const uint8 *hash_stage2)
|
||||||
{
|
{
|
||||||
*to++= PVERSION41_CHAR;
|
*to++= PVERSION41_CHAR;
|
||||||
octet2hex(to, hash_stage2, SHA1_HASH_SIZE);
|
octet2hex(to, (const char*) hash_stage2, SHA1_HASH_SIZE);
|
||||||
}
|
}
|
||||||
|
@ -1965,6 +1965,7 @@ CHARSET_INFO *get_old_charset_by_name(const char *name)
|
|||||||
bool sys_var_collation::check(THD *thd, set_var *var)
|
bool sys_var_collation::check(THD *thd, set_var *var)
|
||||||
{
|
{
|
||||||
CHARSET_INFO *tmp;
|
CHARSET_INFO *tmp;
|
||||||
|
LINT_INIT(tmp);
|
||||||
|
|
||||||
if (var->value->result_type() == STRING_RESULT)
|
if (var->value->result_type() == STRING_RESULT)
|
||||||
{
|
{
|
||||||
@ -1999,6 +2000,7 @@ bool sys_var_collation::check(THD *thd, set_var *var)
|
|||||||
bool sys_var_character_set::check(THD *thd, set_var *var)
|
bool sys_var_character_set::check(THD *thd, set_var *var)
|
||||||
{
|
{
|
||||||
CHARSET_INFO *tmp;
|
CHARSET_INFO *tmp;
|
||||||
|
LINT_INIT(tmp);
|
||||||
|
|
||||||
if (var->value->result_type() == STRING_RESULT)
|
if (var->value->result_type() == STRING_RESULT)
|
||||||
{
|
{
|
||||||
|
@ -3613,7 +3613,7 @@ Slave SQL thread aborted. Can't execute init_slave query");
|
|||||||
thd->net.last_error ?
|
thd->net.last_error ?
|
||||||
thd->net.last_error : "<no message>");
|
thd->net.last_error : "<no message>");
|
||||||
}
|
}
|
||||||
else if (rli->last_slave_errno != thd->net.last_errno)
|
else if (rli->last_slave_errno != (int) thd->net.last_errno)
|
||||||
{
|
{
|
||||||
sql_print_error("Slave (additional info): %s Error_code: %d",
|
sql_print_error("Slave (additional info): %s Error_code: %d",
|
||||||
thd->net.last_error ?
|
thd->net.last_error ?
|
||||||
@ -4095,6 +4095,7 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
|
|||||||
buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT /* a way to escape */)
|
buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT /* a way to escape */)
|
||||||
DBUG_RETURN(queue_old_event(mi,buf,event_len));
|
DBUG_RETURN(queue_old_event(mi,buf,event_len));
|
||||||
|
|
||||||
|
LINT_INIT(inc_pos);
|
||||||
pthread_mutex_lock(&mi->data_lock);
|
pthread_mutex_lock(&mi->data_lock);
|
||||||
|
|
||||||
switch (buf[EVENT_TYPE_OFFSET]) {
|
switch (buf[EVENT_TYPE_OFFSET]) {
|
||||||
|
@ -1224,10 +1224,10 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
|
|||||||
sp_rcontext *octx = thd->spcont;
|
sp_rcontext *octx = thd->spcont;
|
||||||
sp_rcontext *nctx = NULL;
|
sp_rcontext *nctx = NULL;
|
||||||
bool err_status= FALSE;
|
bool err_status= FALSE;
|
||||||
|
|
||||||
DBUG_ENTER("sp_head::execute_function");
|
DBUG_ENTER("sp_head::execute_function");
|
||||||
DBUG_PRINT("info", ("function %s", m_name.str));
|
DBUG_PRINT("info", ("function %s", m_name.str));
|
||||||
|
|
||||||
|
LINT_INIT(binlog_save_options);
|
||||||
params = m_pcont->context_pvars();
|
params = m_pcont->context_pvars();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -5037,6 +5037,8 @@ static int handle_grant_struct(uint struct_no, bool drop,
|
|||||||
LINT_INIT(acl_user);
|
LINT_INIT(acl_user);
|
||||||
LINT_INIT(acl_db);
|
LINT_INIT(acl_db);
|
||||||
LINT_INIT(grant_name);
|
LINT_INIT(grant_name);
|
||||||
|
LINT_INIT(user);
|
||||||
|
LINT_INIT(host);
|
||||||
|
|
||||||
/* Get the number of elements in the in-memory structure. */
|
/* Get the number of elements in the in-memory structure. */
|
||||||
switch (struct_no) {
|
switch (struct_no) {
|
||||||
@ -5109,8 +5111,7 @@ static int handle_grant_struct(uint struct_no, bool drop,
|
|||||||
result= 1; /* At least one element found. */
|
result= 1; /* At least one element found. */
|
||||||
if ( drop )
|
if ( drop )
|
||||||
{
|
{
|
||||||
switch ( struct_no )
|
switch ( struct_no ) {
|
||||||
{
|
|
||||||
case 0:
|
case 0:
|
||||||
delete_dynamic_element(&acl_users, idx);
|
delete_dynamic_element(&acl_users, idx);
|
||||||
break;
|
break;
|
||||||
|
@ -176,8 +176,7 @@ err:
|
|||||||
|
|
||||||
bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
|
bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
|
||||||
{
|
{
|
||||||
const char *begin, *end = str + str_len;
|
const char *begin, *end= str + str_len;
|
||||||
|
|
||||||
DBUG_ENTER("test_if_number");
|
DBUG_ENTER("test_if_number");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -186,13 +185,13 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
|
|||||||
*/
|
*/
|
||||||
for (; str != end && my_isspace(system_charset_info, *str); str++) ;
|
for (; str != end && my_isspace(system_charset_info, *str); str++) ;
|
||||||
if (str == end)
|
if (str == end)
|
||||||
return 0;
|
DBUG_RETURN(0);
|
||||||
|
|
||||||
if (*str == '-')
|
if (*str == '-')
|
||||||
{
|
{
|
||||||
info->negative = 1;
|
info->negative = 1;
|
||||||
if (++str == end || *str == '0') // converting -0 to a number
|
if (++str == end || *str == '0') // converting -0 to a number
|
||||||
return 0; // might lose information
|
DBUG_RETURN(0); // might lose information
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
info->negative = 0;
|
info->negative = 0;
|
||||||
@ -210,33 +209,33 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
|
|||||||
int error;
|
int error;
|
||||||
info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error);
|
info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error);
|
||||||
if (info->integers == 1)
|
if (info->integers == 1)
|
||||||
return 0; // a single number can't be zerofill
|
DBUG_RETURN(0); // single number can't be zerofill
|
||||||
info->maybe_zerofill = 1;
|
info->maybe_zerofill = 1;
|
||||||
return 1; // a zerofill number, or an integer
|
DBUG_RETURN(1); // a zerofill number, or an integer
|
||||||
}
|
}
|
||||||
if (*str == '.' || *str == 'e' || *str == 'E')
|
if (*str == '.' || *str == 'e' || *str == 'E')
|
||||||
{
|
{
|
||||||
if (info->zerofill) // can't be zerofill anymore
|
if (info->zerofill) // can't be zerofill anymore
|
||||||
return 0;
|
DBUG_RETURN(0);
|
||||||
if ((str + 1) == end) // number was something like '123[.eE]'
|
if ((str + 1) == end) // number was something like '123[.eE]'
|
||||||
{
|
{
|
||||||
char *endpos= (char*) str;
|
char *endpos= (char*) str;
|
||||||
int error;
|
int error;
|
||||||
info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error);
|
info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error);
|
||||||
return 1;
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
if (*str == 'e' || *str == 'E') // number may be something like '1e+50'
|
if (*str == 'e' || *str == 'E') // number may be something like '1e+50'
|
||||||
{
|
{
|
||||||
str++;
|
str++;
|
||||||
if (*str != '-' && *str != '+')
|
if (*str != '-' && *str != '+')
|
||||||
return 0;
|
DBUG_RETURN(0);
|
||||||
for (str++; str != end && my_isdigit(system_charset_info,*str); str++) ;
|
for (str++; str != end && my_isdigit(system_charset_info,*str); str++) ;
|
||||||
if (str == end)
|
if (str == end)
|
||||||
{
|
{
|
||||||
info->is_float = 1; // we can't use variable decimals here
|
info->is_float = 1; // we can't use variable decimals here
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
for (str++; *(end - 1) == '0'; end--); // jump over zeros at the end
|
for (str++; *(end - 1) == '0'; end--); // jump over zeros at the end
|
||||||
if (str == end) // number was something like '123.000'
|
if (str == end) // number was something like '123.000'
|
||||||
@ -244,17 +243,17 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
|
|||||||
char *endpos= (char*) str;
|
char *endpos= (char*) str;
|
||||||
int error;
|
int error;
|
||||||
info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error);
|
info->ullval= (ulonglong) my_strtoll10(begin, &endpos, &error);
|
||||||
return 1;
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
for (; str != end && my_isdigit(system_charset_info,*str); str++)
|
for (; str != end && my_isdigit(system_charset_info,*str); str++)
|
||||||
info->decimals++;
|
info->decimals++;
|
||||||
if (str == end)
|
if (str == end)
|
||||||
{
|
{
|
||||||
info->dval = my_atof(begin);
|
info->dval = my_atof(begin);
|
||||||
return 1;
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1877,7 +1877,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
|
|||||||
if (!thd->open_tables)
|
if (!thd->open_tables)
|
||||||
thd->version=refresh_version;
|
thd->version=refresh_version;
|
||||||
else if ((thd->version != refresh_version) &&
|
else if ((thd->version != refresh_version) &&
|
||||||
! (flags & MYSQL_LOCK_IGNORE_FLUSH) && !table->s->log_table)
|
! (flags & MYSQL_LOCK_IGNORE_FLUSH))
|
||||||
{
|
{
|
||||||
/* Someone did a refresh while thread was opening tables */
|
/* Someone did a refresh while thread was opening tables */
|
||||||
if (refresh)
|
if (refresh)
|
||||||
@ -2349,13 +2349,36 @@ bool wait_for_tables(THD *thd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* drop tables from locked list */
|
/*
|
||||||
|
drop tables from locked list
|
||||||
|
|
||||||
bool drop_locked_tables(THD *thd,const char *db, const char *table_name)
|
SYNOPSIS
|
||||||
|
drop_locked_tables()
|
||||||
|
thd Thread thandler
|
||||||
|
db Database
|
||||||
|
table_name Table name
|
||||||
|
|
||||||
|
INFORMATION
|
||||||
|
This is only called on drop tables
|
||||||
|
|
||||||
|
The TABLE object for the dropped table is unlocked but still kept around
|
||||||
|
as a name lock, which means that the table will be available for other
|
||||||
|
thread as soon as we call unlock_table_names().
|
||||||
|
If there is multiple copies of the table locked, all copies except
|
||||||
|
the first, which acts as a name lock, is removed.
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
# If table existed, return table
|
||||||
|
0 Table was not locked
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
TABLE *drop_locked_tables(THD *thd,const char *db, const char *table_name)
|
||||||
{
|
{
|
||||||
TABLE *table,*next,**prev;
|
TABLE *table,*next,**prev, *found= 0;
|
||||||
bool found=0;
|
|
||||||
prev= &thd->open_tables;
|
prev= &thd->open_tables;
|
||||||
|
DBUG_ENTER("drop_locked_tables");
|
||||||
|
|
||||||
for (table= thd->open_tables; table ; table=next)
|
for (table= thd->open_tables; table ; table=next)
|
||||||
{
|
{
|
||||||
next=table->next;
|
next=table->next;
|
||||||
@ -2363,8 +2386,21 @@ bool drop_locked_tables(THD *thd,const char *db, const char *table_name)
|
|||||||
!strcmp(table->s->db.str, db))
|
!strcmp(table->s->db.str, db))
|
||||||
{
|
{
|
||||||
mysql_lock_remove(thd, thd->locked_tables,table);
|
mysql_lock_remove(thd, thd->locked_tables,table);
|
||||||
VOID(hash_delete(&open_cache,(byte*) table));
|
if (!found)
|
||||||
found=1;
|
{
|
||||||
|
found= table;
|
||||||
|
/* Close engine table, but keep object around as a name lock */
|
||||||
|
if (table->db_stat)
|
||||||
|
{
|
||||||
|
table->db_stat= 0;
|
||||||
|
table->file->close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* We already have a name lock, remove copy */
|
||||||
|
VOID(hash_delete(&open_cache,(byte*) table));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2373,14 +2409,12 @@ bool drop_locked_tables(THD *thd,const char *db, const char *table_name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
*prev=0;
|
*prev=0;
|
||||||
if (found)
|
|
||||||
VOID(pthread_cond_broadcast(&COND_refresh)); // Signal to refresh
|
|
||||||
if (thd->locked_tables && thd->locked_tables->table_count == 0)
|
if (thd->locked_tables && thd->locked_tables->table_count == 0)
|
||||||
{
|
{
|
||||||
my_free((gptr) thd->locked_tables,MYF(0));
|
my_free((gptr) thd->locked_tables,MYF(0));
|
||||||
thd->locked_tables=0;
|
thd->locked_tables=0;
|
||||||
}
|
}
|
||||||
return found;
|
DBUG_RETURN(found);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3489,6 +3523,7 @@ find_field_in_view(THD *thd, TABLE_LIST *table_list,
|
|||||||
Field_iterator_view field_it;
|
Field_iterator_view field_it;
|
||||||
field_it.set(table_list);
|
field_it.set(table_list);
|
||||||
Query_arena *arena, backup;
|
Query_arena *arena, backup;
|
||||||
|
LINT_INIT(arena);
|
||||||
|
|
||||||
DBUG_ASSERT(table_list->schema_table_reformed ||
|
DBUG_ASSERT(table_list->schema_table_reformed ||
|
||||||
(ref != 0 && table_list->view != 0));
|
(ref != 0 && table_list->view != 0));
|
||||||
@ -3578,6 +3613,7 @@ find_field_in_natural_join(THD *thd, TABLE_LIST *table_ref, const char *name,
|
|||||||
DBUG_ASSERT(table_ref->is_natural_join && table_ref->join_columns);
|
DBUG_ASSERT(table_ref->is_natural_join && table_ref->join_columns);
|
||||||
DBUG_ASSERT(*actual_table == NULL);
|
DBUG_ASSERT(*actual_table == NULL);
|
||||||
|
|
||||||
|
LINT_INIT(arena);
|
||||||
LINT_INIT(found_field);
|
LINT_INIT(found_field);
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
|
@ -37,7 +37,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
|
|||||||
READ_RECORD info;
|
READ_RECORD info;
|
||||||
bool using_limit=limit != HA_POS_ERROR;
|
bool using_limit=limit != HA_POS_ERROR;
|
||||||
bool transactional_table, safe_update, const_cond;
|
bool transactional_table, safe_update, const_cond;
|
||||||
ha_rows deleted;
|
ha_rows deleted= 0;
|
||||||
uint usable_index= MAX_KEY;
|
uint usable_index= MAX_KEY;
|
||||||
SELECT_LEX *select_lex= &thd->lex->select_lex;
|
SELECT_LEX *select_lex= &thd->lex->select_lex;
|
||||||
bool ha_delete_all_rows= 0;
|
bool ha_delete_all_rows= 0;
|
||||||
@ -212,7 +212,6 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
|
|||||||
else
|
else
|
||||||
init_read_record_idx(&info, thd, table, 1, usable_index);
|
init_read_record_idx(&info, thd, table, 1, usable_index);
|
||||||
|
|
||||||
deleted=0L;
|
|
||||||
init_ftfuncs(thd, select_lex, 1);
|
init_ftfuncs(thd, select_lex, 1);
|
||||||
thd->proc_info="updating";
|
thd->proc_info="updating";
|
||||||
will_batch= !table->file->start_bulk_delete();
|
will_batch= !table->file->start_bulk_delete();
|
||||||
|
@ -2112,8 +2112,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
|||||||
|
|
||||||
void log_slow_statement(THD *thd)
|
void log_slow_statement(THD *thd)
|
||||||
{
|
{
|
||||||
DBUG_ENTER("log_slow_statement");
|
|
||||||
time_t start_of_query;
|
time_t start_of_query;
|
||||||
|
DBUG_ENTER("log_slow_statement");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The following should never be true with our current code base,
|
The following should never be true with our current code base,
|
||||||
@ -2121,7 +2121,7 @@ void log_slow_statement(THD *thd)
|
|||||||
statement in a trigger or stored function
|
statement in a trigger or stored function
|
||||||
*/
|
*/
|
||||||
if (unlikely(thd->in_sub_stmt))
|
if (unlikely(thd->in_sub_stmt))
|
||||||
return; // Don't set time for sub stmt
|
DBUG_VOID_RETURN; // Don't set time for sub stmt
|
||||||
|
|
||||||
start_of_query= thd->start_time;
|
start_of_query= thd->start_time;
|
||||||
thd->end_time(); // Set start time
|
thd->end_time(); // Set start time
|
||||||
@ -5864,18 +5864,15 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
|
|||||||
{
|
{
|
||||||
if (thd->net.report_error)
|
if (thd->net.report_error)
|
||||||
{
|
{
|
||||||
if (thd->lex->sphead)
|
delete lex->sphead;
|
||||||
{
|
lex->sphead= NULL;
|
||||||
delete thd->lex->sphead;
|
if (lex->et)
|
||||||
thd->lex->sphead= NULL;
|
|
||||||
}
|
|
||||||
if (thd->lex->et)
|
|
||||||
{
|
{
|
||||||
thd->lex->et->free_sphead_on_delete= true;
|
lex->et->free_sphead_on_delete= true;
|
||||||
/* alloced on thd->mem_root so no real memory free but dtor call */
|
/* alloced on thd->mem_root so no real memory free but dtor call */
|
||||||
thd->lex->et->free_sp();
|
lex->et->free_sp();
|
||||||
thd->lex->et->deinit_mutexes();
|
lex->et->deinit_mutexes();
|
||||||
thd->lex->et= NULL;
|
lex->et= NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -5906,18 +5903,18 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
|
|||||||
thd->is_fatal_error));
|
thd->is_fatal_error));
|
||||||
query_cache_abort(&thd->net);
|
query_cache_abort(&thd->net);
|
||||||
lex->unit.cleanup();
|
lex->unit.cleanup();
|
||||||
if (thd->lex->sphead)
|
if (lex->sphead)
|
||||||
{
|
{
|
||||||
/* Clean up after failed stored procedure/function */
|
/* Clean up after failed stored procedure/function */
|
||||||
delete thd->lex->sphead;
|
delete lex->sphead;
|
||||||
thd->lex->sphead= NULL;
|
lex->sphead= NULL;
|
||||||
}
|
}
|
||||||
if (thd->lex->et)
|
if (lex->et)
|
||||||
{
|
{
|
||||||
thd->lex->et->free_sphead_on_delete= true;
|
lex->et->free_sphead_on_delete= true;
|
||||||
lex->et->free_sp();
|
lex->et->free_sp();
|
||||||
lex->et->deinit_mutexes();
|
lex->et->deinit_mutexes();
|
||||||
thd->lex->et= NULL;
|
lex->et= NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
thd->proc_info="freeing items";
|
thd->proc_info="freeing items";
|
||||||
|
@ -4924,7 +4924,7 @@ the generated partition syntax in a correct manner.
|
|||||||
*/
|
*/
|
||||||
if (table->part_info)
|
if (table->part_info)
|
||||||
{
|
{
|
||||||
if (thd->lex->alter_info.flags & ALTER_REMOVE_PARTITIONING)
|
if (alter_info->flags & ALTER_REMOVE_PARTITIONING)
|
||||||
{
|
{
|
||||||
DBUG_PRINT("info", ("Remove partitioning"));
|
DBUG_PRINT("info", ("Remove partitioning"));
|
||||||
if (!(thd->lex->create_info.used_fields & HA_CREATE_USED_ENGINE))
|
if (!(thd->lex->create_info.used_fields & HA_CREATE_USED_ENGINE))
|
||||||
|
@ -192,7 +192,8 @@ static st_plugin_dl *plugin_dl_add(LEX_STRING *dl, int report)
|
|||||||
|
|
||||||
if (plugin_dl.version != MYSQL_PLUGIN_INTERFACE_VERSION)
|
if (plugin_dl.version != MYSQL_PLUGIN_INTERFACE_VERSION)
|
||||||
{
|
{
|
||||||
int i, sizeof_st_plugin;
|
int i;
|
||||||
|
uint sizeof_st_plugin;
|
||||||
struct st_mysql_plugin *old, *cur;
|
struct st_mysql_plugin *old, *cur;
|
||||||
char *ptr= (char *)sym;
|
char *ptr= (char *)sym;
|
||||||
|
|
||||||
|
@ -1770,18 +1770,19 @@ void free_status_vars()
|
|||||||
there's lots of room for optimizing this, especially in non-sorted mode,
|
there's lots of room for optimizing this, especially in non-sorted mode,
|
||||||
but nobody cares - it may be called only in case of failed plugin
|
but nobody cares - it may be called only in case of failed plugin
|
||||||
initialization in the mysqld startup.
|
initialization in the mysqld startup.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void remove_status_vars(SHOW_VAR *list)
|
void remove_status_vars(SHOW_VAR *list)
|
||||||
{
|
{
|
||||||
if (status_vars_inited)
|
if (status_vars_inited)
|
||||||
{
|
{
|
||||||
pthread_mutex_lock(&LOCK_status);
|
pthread_mutex_lock(&LOCK_status);
|
||||||
SHOW_VAR *all= dynamic_element(&all_status_vars, 0, SHOW_VAR *);
|
SHOW_VAR *all= dynamic_element(&all_status_vars, 0, SHOW_VAR *);
|
||||||
int a= 0, b= all_status_vars.elements, c= (a+b)/2, res;
|
int a= 0, b= all_status_vars.elements, c= (a+b)/2;
|
||||||
|
|
||||||
for (; list->name; list++)
|
for (; list->name; list++)
|
||||||
{
|
{
|
||||||
|
int res= 0;
|
||||||
for (a= 0, b= all_status_vars.elements; b-a > 1; c= (a+b)/2)
|
for (a= 0, b= all_status_vars.elements; b-a > 1; c= (a+b)/2)
|
||||||
{
|
{
|
||||||
res= show_var_cmp(list, all+c);
|
res= show_var_cmp(list, all+c);
|
||||||
@ -1789,7 +1790,8 @@ void remove_status_vars(SHOW_VAR *list)
|
|||||||
b= c;
|
b= c;
|
||||||
else if (res > 0)
|
else if (res > 0)
|
||||||
a= c;
|
a= c;
|
||||||
else break;
|
else
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
all[c].type= SHOW_UNDEF;
|
all[c].type= SHOW_UNDEF;
|
||||||
@ -1800,7 +1802,7 @@ void remove_status_vars(SHOW_VAR *list)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
SHOW_VAR *all= dynamic_element(&all_status_vars, 0, SHOW_VAR *);
|
SHOW_VAR *all= dynamic_element(&all_status_vars, 0, SHOW_VAR *);
|
||||||
int i;
|
uint i;
|
||||||
for (; list->name; list++)
|
for (; list->name; list++)
|
||||||
{
|
{
|
||||||
for (i= 0; i < all_status_vars.elements; i++)
|
for (i= 0; i < all_status_vars.elements; i++)
|
||||||
|
@ -565,6 +565,10 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
|
|||||||
String built_query;
|
String built_query;
|
||||||
DBUG_ENTER("mysql_rm_table_part2");
|
DBUG_ENTER("mysql_rm_table_part2");
|
||||||
|
|
||||||
|
LINT_INIT(alias);
|
||||||
|
LINT_INIT(path_length);
|
||||||
|
safe_mutex_assert_owner(&LOCK_open);
|
||||||
|
|
||||||
if (thd->current_stmt_binlog_row_based && !dont_log_query)
|
if (thd->current_stmt_binlog_row_based && !dont_log_query)
|
||||||
{
|
{
|
||||||
built_query.set_charset(system_charset_info);
|
built_query.set_charset(system_charset_info);
|
||||||
@ -614,7 +618,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
|
|||||||
*/
|
*/
|
||||||
if (thd->current_stmt_binlog_row_based && !dont_log_query)
|
if (thd->current_stmt_binlog_row_based && !dont_log_query)
|
||||||
{
|
{
|
||||||
++non_temp_tables_count;
|
non_temp_tables_count++;
|
||||||
/*
|
/*
|
||||||
Don't write the database name if it is the current one (or if
|
Don't write the database name if it is the current one (or if
|
||||||
thd->db is NULL).
|
thd->db is NULL).
|
||||||
@ -634,11 +638,18 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
|
|||||||
table_type= table->db_type;
|
table_type= table->db_type;
|
||||||
if (!drop_temporary)
|
if (!drop_temporary)
|
||||||
{
|
{
|
||||||
|
TABLE *locked_table;
|
||||||
abort_locked_tables(thd, db, table->table_name);
|
abort_locked_tables(thd, db, table->table_name);
|
||||||
remove_table_from_cache(thd, db, table->table_name,
|
remove_table_from_cache(thd, db, table->table_name,
|
||||||
RTFC_WAIT_OTHER_THREAD_FLAG |
|
RTFC_WAIT_OTHER_THREAD_FLAG |
|
||||||
RTFC_CHECK_KILLED_FLAG);
|
RTFC_CHECK_KILLED_FLAG);
|
||||||
drop_locked_tables(thd, db, table->table_name);
|
/*
|
||||||
|
If the table was used in lock tables, remember it so that
|
||||||
|
unlock_table_names can free it
|
||||||
|
*/
|
||||||
|
if ((locked_table= drop_locked_tables(thd, db, table->table_name)))
|
||||||
|
table->table= locked_table;
|
||||||
|
|
||||||
if (thd->killed)
|
if (thd->killed)
|
||||||
{
|
{
|
||||||
thd->no_warnings_for_error= 0;
|
thd->no_warnings_for_error= 0;
|
||||||
@ -649,8 +660,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
|
|||||||
path_length= build_table_filename(path, sizeof(path),
|
path_length= build_table_filename(path, sizeof(path),
|
||||||
db, alias, reg_ext);
|
db, alias, reg_ext);
|
||||||
}
|
}
|
||||||
if (table_type == NULL &&
|
if (drop_temporary ||
|
||||||
(drop_temporary ||
|
(table_type == NULL &&
|
||||||
(access(path, F_OK) &&
|
(access(path, F_OK) &&
|
||||||
ha_create_table_from_engine(thd, db, alias)) ||
|
ha_create_table_from_engine(thd, db, alias)) ||
|
||||||
(!drop_view &&
|
(!drop_view &&
|
||||||
@ -3962,6 +3973,11 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
|||||||
bool committed= 0;
|
bool committed= 0;
|
||||||
DBUG_ENTER("mysql_alter_table");
|
DBUG_ENTER("mysql_alter_table");
|
||||||
|
|
||||||
|
LINT_INIT(index_add_count);
|
||||||
|
LINT_INIT(index_drop_count);
|
||||||
|
LINT_INIT(index_add_buffer);
|
||||||
|
LINT_INIT(index_drop_buffer);
|
||||||
|
|
||||||
thd->proc_info="init";
|
thd->proc_info="init";
|
||||||
table_name=table_list->table_name;
|
table_name=table_list->table_name;
|
||||||
alias= (lower_case_table_names == 2) ? table_list->alias : table_name;
|
alias= (lower_case_table_names == 2) ? table_list->alias : table_name;
|
||||||
|
@ -4726,13 +4726,14 @@ alter:
|
|||||||
lex->col_list.empty();
|
lex->col_list.empty();
|
||||||
lex->select_lex.init_order();
|
lex->select_lex.init_order();
|
||||||
lex->select_lex.db=lex->name= 0;
|
lex->select_lex.db=lex->name= 0;
|
||||||
lex->like_name= 0;
|
lex->like_name= 0;
|
||||||
bzero((char*) &lex->create_info,sizeof(lex->create_info));
|
bzero((char*) &lex->create_info,sizeof(lex->create_info));
|
||||||
lex->create_info.db_type= (handlerton*) &default_hton;
|
lex->create_info.db_type= (handlerton*) &default_hton;
|
||||||
lex->create_info.default_table_charset= NULL;
|
lex->create_info.default_table_charset= NULL;
|
||||||
lex->create_info.row_type= ROW_TYPE_NOT_USED;
|
lex->create_info.row_type= ROW_TYPE_NOT_USED;
|
||||||
lex->alter_info.reset();
|
lex->alter_info.reset();
|
||||||
lex->alter_info.flags= 0;
|
lex->alter_info.flags= 0;
|
||||||
|
lex->no_write_to_binlog= 0;
|
||||||
}
|
}
|
||||||
alter_commands
|
alter_commands
|
||||||
{}
|
{}
|
||||||
|
18
sql/table.cc
18
sql/table.cc
@ -1556,7 +1556,15 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
|
|||||||
DBUG_RETURN (error);
|
DBUG_RETURN (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* close a .frm file and it's tables */
|
|
||||||
|
/*
|
||||||
|
Free information allocated by openfrm
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
closefrm()
|
||||||
|
table TABLE object to free
|
||||||
|
free_share Is 1 if we also want to free table_share
|
||||||
|
*/
|
||||||
|
|
||||||
int closefrm(register TABLE *table, bool free_share)
|
int closefrm(register TABLE *table, bool free_share)
|
||||||
{
|
{
|
||||||
@ -1564,6 +1572,7 @@ int closefrm(register TABLE *table, bool free_share)
|
|||||||
uint idx;
|
uint idx;
|
||||||
KEY *key_info;
|
KEY *key_info;
|
||||||
DBUG_ENTER("closefrm");
|
DBUG_ENTER("closefrm");
|
||||||
|
|
||||||
if (table->db_stat)
|
if (table->db_stat)
|
||||||
error=table->file->close();
|
error=table->file->close();
|
||||||
key_info= table->key_info;
|
key_info= table->key_info;
|
||||||
@ -2395,12 +2404,14 @@ table_check_intact(TABLE *table, uint table_f_count,
|
|||||||
table running on a old server will be valid.
|
table running on a old server will be valid.
|
||||||
*/
|
*/
|
||||||
field->sql_type(sql_type);
|
field->sql_type(sql_type);
|
||||||
if (strncmp(sql_type.c_ptr(), table_def->type.str,
|
if (sql_type.length() < table_def->type.length - 1 ||
|
||||||
|
strncmp(sql_type.ptr(),
|
||||||
|
table_def->type.str,
|
||||||
table_def->type.length - 1))
|
table_def->type.length - 1))
|
||||||
{
|
{
|
||||||
sql_print_error("(%s) Expected field %s at position %d to have type "
|
sql_print_error("(%s) Expected field %s at position %d to have type "
|
||||||
"%s, found %s", table->alias, table_def->name.str,
|
"%s, found %s", table->alias, table_def->name.str,
|
||||||
i, table_def->type.str, sql_type.c_ptr());
|
i, table_def->type.str, sql_type.c_ptr_safe());
|
||||||
error= TRUE;
|
error= TRUE;
|
||||||
}
|
}
|
||||||
else if (table_def->cset.str && !field->has_charset())
|
else if (table_def->cset.str && !field->has_charset())
|
||||||
@ -3621,6 +3632,7 @@ Field_iterator_table_ref::get_or_create_column_ref(TABLE_LIST *parent_table_ref)
|
|||||||
TABLE_LIST *add_table_ref= parent_table_ref ?
|
TABLE_LIST *add_table_ref= parent_table_ref ?
|
||||||
parent_table_ref : table_ref;
|
parent_table_ref : table_ref;
|
||||||
|
|
||||||
|
LINT_INIT(field_count);
|
||||||
if (field_it == &table_field_it)
|
if (field_it == &table_field_it)
|
||||||
{
|
{
|
||||||
/* The field belongs to a stored table. */
|
/* The field belongs to a stored table. */
|
||||||
|
@ -2189,12 +2189,11 @@ my_tz_find(const String * name, TABLE_LIST *tz_tables)
|
|||||||
TZ_NAMES_ENTRY *tmp_tzname;
|
TZ_NAMES_ENTRY *tmp_tzname;
|
||||||
Time_zone *result_tz= 0;
|
Time_zone *result_tz= 0;
|
||||||
long offset;
|
long offset;
|
||||||
|
|
||||||
DBUG_ENTER("my_tz_find");
|
DBUG_ENTER("my_tz_find");
|
||||||
DBUG_PRINT("enter", ("time zone name='%s'",
|
DBUG_PRINT("enter", ("time zone name='%s'",
|
||||||
name ? ((String *)name)->c_ptr() : "NULL"));
|
name ? ((String *)name)->c_ptr_safe() : "NULL"));
|
||||||
|
DBUG_ASSERT(!time_zone_tables_exist || tz_tables ||
|
||||||
DBUG_ASSERT(!time_zone_tables_exist || tz_tables || current_thd->slave_thread);
|
current_thd->slave_thread);
|
||||||
|
|
||||||
if (!name)
|
if (!name)
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
|
@ -108,6 +108,7 @@ private:
|
|||||||
Uint16 m_entries;
|
Uint16 m_entries;
|
||||||
Uint8 m_idir;
|
Uint8 m_idir;
|
||||||
Uint8 pad1;
|
Uint8 pad1;
|
||||||
|
Area() {}
|
||||||
Pointer& get_pointer(unsigned i) const {
|
Pointer& get_pointer(unsigned i) const {
|
||||||
return *(Pointer*)&m_data[i];
|
return *(Pointer*)&m_data[i];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user