32
29
const char *any_db="*any*"; // Special symbol for check_access
34
const LEX_STRING command_name[]={
31
const LEX_STRING command_name[COM_END+1]={
35
32
{ C_STRING_WITH_LEN("Sleep") },
36
33
{ C_STRING_WITH_LEN("Quit") },
37
34
{ C_STRING_WITH_LEN("Init DB") },
45
42
{ C_STRING_WITH_LEN("Processlist") },
46
43
{ C_STRING_WITH_LEN("Connect") },
47
44
{ C_STRING_WITH_LEN("Kill") },
48
{ C_STRING_WITH_LEN("Debug") },
49
45
{ C_STRING_WITH_LEN("Ping") },
50
46
{ C_STRING_WITH_LEN("Time") },
51
{ C_STRING_WITH_LEN("Delayed insert") },
52
47
{ C_STRING_WITH_LEN("Change user") },
53
48
{ C_STRING_WITH_LEN("Binlog Dump") },
54
{ C_STRING_WITH_LEN("Table Dump") },
55
49
{ C_STRING_WITH_LEN("Connect Out") },
56
50
{ C_STRING_WITH_LEN("Register Slave") },
57
{ C_STRING_WITH_LEN("Prepare") },
58
{ C_STRING_WITH_LEN("Execute") },
59
{ C_STRING_WITH_LEN("Long Data") },
60
{ C_STRING_WITH_LEN("Close stmt") },
61
{ C_STRING_WITH_LEN("Reset stmt") },
62
51
{ C_STRING_WITH_LEN("Set option") },
63
{ C_STRING_WITH_LEN("Fetch") },
64
52
{ C_STRING_WITH_LEN("Daemon") },
65
53
{ C_STRING_WITH_LEN("Error") } // Last command number
178
166
void init_update_queries(void)
180
bzero((uchar*) &sql_command_flags, sizeof(sql_command_flags));
168
memset((uchar*) &sql_command_flags, 0, sizeof(sql_command_flags));
182
170
sql_command_flags[SQLCOM_CREATE_TABLE]= CF_CHANGES_DATA;
183
171
sql_command_flags[SQLCOM_CREATE_INDEX]= CF_CHANGES_DATA;
254
242
rw_rdlock(var_mutex);
255
243
save_client_capabilities= thd->client_capabilities;
256
thd->client_capabilities|= CLIENT_MULTI_QUERIES;
244
thd->client_capabilities|= CLIENT_MULTI_STATEMENTS;
258
246
We don't need return result of execution to client side.
259
247
To forbid this we should set thd->net.vio to 0.
739
727
status_var_increment(thd->status_var.com_stat[SQLCOM_SHOW_FIELDS]);
740
bzero((char*) &table_list,sizeof(table_list));
728
memset((char*) &table_list, 0, sizeof(table_list));
741
729
if (thd->copy_db_to(&table_list.db, &table_list.db_length))
822
810
SHUTDOWN_DEFAULT is 0. If client is >= 4.1.3, the shutdown level is in
825
enum mysql_enum_shutdown_level level=
826
(enum mysql_enum_shutdown_level) (uchar) packet[0];
813
enum drizzle_enum_shutdown_level level=
814
(enum drizzle_enum_shutdown_level) (uchar) packet[0];
827
815
if (level == SHUTDOWN_DEFAULT)
828
816
level= SHUTDOWN_WAIT_ALL_BUFFERS; // soon default will be configurable
829
817
else if (level != SHUTDOWN_WAIT_ALL_BUFFERS)
1649
1637
thd->enable_slow_log= opt_log_slow_admin_statements;
1651
bzero((char*) &create_info, sizeof(create_info));
1639
memset((char*) &create_info, 0, sizeof(create_info));
1652
1640
create_info.db_type= 0;
1653
1641
create_info.row_type= ROW_TYPE_NOT_USED;
1654
1642
create_info.default_table_charset= thd->variables.collation_database;
1715
1703
{ // Rename of table
1716
1704
TABLE_LIST tmp_table;
1717
bzero((char*) &tmp_table,sizeof(tmp_table));
1705
memset((char*) &tmp_table, 0, sizeof(tmp_table));
1718
1706
tmp_table.table_name= lex->name.str;
1719
1707
tmp_table.db=select_lex->db;
2681
2669
if (lex->describe & DESCRIBE_EXTENDED)
2683
2671
char buff[1024];
2684
String str(buff,(uint32) sizeof(buff), system_charset_info);
2672
String str(buff,(uint32_t) sizeof(buff), system_charset_info);
2686
2674
thd->lex->unit.print(&str, QT_ORDINARY);
2687
2675
str.append('\0');
2940
2928
lex->sql_command= SQLCOM_SELECT;
2941
2929
tmp.str= (char*) var_name;
2942
2930
tmp.length=strlen(var_name);
2943
bzero((char*) &null_lex_string.str, sizeof(null_lex_string));
2931
memset((char*) &null_lex_string.str, 0, sizeof(null_lex_string));
2945
2933
We set the name of Item to @@session.var_name because that then is used
2946
2934
as the column name in the output.
3135
3123
if (default_value->type() == Item::FUNC_ITEM &&
3136
3124
!(((Item_func*)default_value)->functype() == Item_func::NOW_FUNC &&
3137
type == MYSQL_TYPE_TIMESTAMP))
3125
type == DRIZZLE_TYPE_TIMESTAMP))
3139
3127
my_error(ER_INVALID_DEFAULT, MYF(0), field_name->str);
3925
3913
This is written such that we have a short lock on LOCK_thread_count
3928
uint kill_one_thread(THD *thd __attribute__((__unused__)),
3929
ulong id, bool only_kill_query)
3917
kill_one_thread(THD *thd __attribute__((unused)),
3918
ulong id, bool only_kill_query)
3932
3921
uint error=ER_NO_SUCH_THREAD;
4145
4134
bool multi_delete_precheck(THD *thd,
4146
TABLE_LIST *tables __attribute__((__unused__)))
4135
TABLE_LIST *tables __attribute__((unused)))
4148
4137
SELECT_LEX *select_lex= &thd->lex->select_lex;
4149
4138
TABLE_LIST **save_query_tables_own_last= thd->lex->query_tables_own_last;
4178
4167
@return Matching table, NULL otherwise.
4181
static TABLE_LIST *multi_delete_table_match(LEX *lex __attribute__((__unused__)),
4170
static TABLE_LIST *multi_delete_table_match(LEX *lex __attribute__((unused)),
4182
4171
TABLE_LIST *tbl,
4183
4172
TABLE_LIST *tables)
4273
bool update_precheck(THD *thd, TABLE_LIST *tables __attribute__((__unused__)))
4262
bool update_precheck(THD *thd, TABLE_LIST *tables __attribute__((unused)))
4275
4264
if (thd->lex->select_lex.item_list.elements != thd->lex->value_list.elements)
4326
4315
bool create_table_precheck(THD *thd,
4327
TABLE_LIST *tables __attribute__((__unused__)),
4316
TABLE_LIST *tables __attribute__((unused)),
4328
4317
TABLE_LIST *create_table)
4330
4319
LEX *lex= thd->lex;
4536
4525
if (home_dir_len < dir_len)
4538
if (lower_case_file_system)
4540
if (!my_strnncoll(character_set_filesystem,
4541
(const uchar*) conv_path, home_dir_len,
4542
(const uchar*) mysql_unpacked_real_data_home,
4546
else if (!memcmp(conv_path, mysql_unpacked_real_data_home, home_dir_len))
4527
if (!my_strnncoll(character_set_filesystem,
4528
(const uchar*) conv_path, home_dir_len,
4529
(const uchar*) mysql_unpacked_real_data_home,