mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
merge
BitKeeper/etc/ignore: auto-union BitKeeper/etc/logging_ok: auto-union BUILD/FINISH.sh: Auto merged BUILD/SETUP.sh: Auto merged BUILD/compile-pentium-debug: Auto merged acconfig.h: Auto merged client/mysql.cc: Auto merged client/mysqldump.c: Auto merged client/mysqltest.c: Auto merged heap/hp_rfirst.c: Auto merged heap/hp_rnext.c: Auto merged include/my_sys.h: Auto merged include/myisam.h: Auto merged libmysql/Makefile.shared: Auto merged myisam/mi_write.c: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/heap.result: Auto merged mysql-test/r/select_found.result: Auto merged mysql-test/r/union.result: Auto merged mysql-test/t/heap.test: Auto merged mysql-test/t/select_found.test: Auto merged mysql-test/t/union.test: Auto merged mysys/mf_iocache2.c: Auto merged mysys/my_vsnprintf.c: Auto merged sql/convert.cc: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/filesort.cc: Auto merged sql/ha_myisam.cc: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/item_strfunc.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/lex.h: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/opt_range.cc: Auto merged sql/opt_range.h: Auto merged sql/opt_sum.cc: Auto merged sql/slave.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_db.cc: Auto merged sql/sql_handler.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_union.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/structs.h: Auto merged sql/table.cc: Auto merged sql/table.h: Auto merged strings/Makefile.am: Auto merged
This commit is contained in:
@ -273,7 +273,8 @@ static void free_user(struct user_conn *uc)
|
||||
|
||||
void init_max_user_conn(void)
|
||||
{
|
||||
(void) hash_init(&hash_user_connections,max_connections,0,0,
|
||||
(void) hash_init(&hash_user_connections,system_charset_info,max_connections,
|
||||
0,0,
|
||||
(hash_get_key) get_key_conn, (void (*)(void*)) free_user,
|
||||
0);
|
||||
}
|
||||
@ -700,7 +701,8 @@ pthread_handler_decl(handle_bootstrap,arg)
|
||||
while (fgets(buff, thd->net.max_packet, file))
|
||||
{
|
||||
uint length=(uint) strlen(buff);
|
||||
while (length && (isspace(buff[length-1]) || buff[length-1] == ';'))
|
||||
while (length && (my_isspace(system_charset_info, buff[length-1]) ||
|
||||
buff[length-1] == ';'))
|
||||
length--;
|
||||
buff[length]=0;
|
||||
thd->current_tablenr=0;
|
||||
@ -926,13 +928,14 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
||||
{
|
||||
packet_length--; // Remove end null
|
||||
/* Remove garage at start and end of query */
|
||||
while (isspace(packet[0]) && packet_length > 0)
|
||||
while (my_isspace(system_charset_info,packet[0]) && packet_length > 0)
|
||||
{
|
||||
packet++;
|
||||
packet_length--;
|
||||
}
|
||||
char *pos=packet+packet_length; // Point at end null
|
||||
while (packet_length > 0 && (pos[-1] == ';' || isspace(pos[-1])))
|
||||
while (packet_length > 0 &&
|
||||
(pos[-1] == ';' || my_isspace(system_charset_info,pos[-1])))
|
||||
{
|
||||
pos--;
|
||||
packet_length--;
|
||||
@ -1233,6 +1236,14 @@ mysql_execute_command(void)
|
||||
Skip if we are in the slave thread, some table rules have been given
|
||||
and the table list says the query should not be replicated
|
||||
*/
|
||||
if (lex->derived_tables)
|
||||
{
|
||||
for (TABLE_LIST *cursor= tables;
|
||||
cursor;
|
||||
cursor=cursor->next)
|
||||
if (cursor->derived && mysql_derived(thd,lex,(SELECT_LEX *)cursor->derived,cursor))
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
if ((lex->select_lex.next && create_total_list(thd,lex,&tables)) ||
|
||||
(table_rules_on && tables && thd->slave_thread &&
|
||||
!tables_ok(thd,tables)))
|
||||
@ -2271,7 +2282,8 @@ mysql_execute_command(void)
|
||||
if (user->password.str &&
|
||||
(strcmp(thd->user,user->user.str) ||
|
||||
user->host.str &&
|
||||
my_strcasecmp(user->host.str, thd->host_or_ip)))
|
||||
my_strcasecmp(system_charset_info,
|
||||
user->host.str, thd->host_or_ip)))
|
||||
{
|
||||
if (check_access(thd, UPDATE_ACL, "mysql",0,1))
|
||||
goto error;
|
||||
@ -2656,7 +2668,7 @@ mysql_init_query(THD *thd)
|
||||
thd->lex.value_list.empty();
|
||||
thd->lex.select_lex.table_list.elements=0;
|
||||
thd->free_list=0; thd->lex.union_option=0;
|
||||
thd->lex.select = &thd->lex.select_lex;
|
||||
thd->lex.select = thd->lex.last_select = &thd->lex.select_lex;
|
||||
thd->lex.select_lex.table_list.first=0;
|
||||
thd->lex.select_lex.table_list.next= (byte**) &thd->lex.select_lex.table_list.first;
|
||||
thd->lex.select_lex.next=0;
|
||||
@ -2683,7 +2695,7 @@ mysql_init_select(LEX *lex)
|
||||
select_lex->order_list.next= (byte**) &select_lex->order_list.first;
|
||||
select_lex->group_list.first=0;
|
||||
select_lex->group_list.next= (byte**) &select_lex->group_list.first;
|
||||
select_lex->next = (SELECT_LEX *)NULL;
|
||||
select_lex->next = select_lex->prev = (SELECT_LEX *)NULL;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -2692,8 +2704,9 @@ mysql_new_select(LEX *lex)
|
||||
SELECT_LEX *select_lex = (SELECT_LEX *) lex->thd->calloc(sizeof(SELECT_LEX));
|
||||
if (!select_lex)
|
||||
return 1;
|
||||
lex->select=lex->last_select;
|
||||
lex->select->next=select_lex;
|
||||
lex->select=select_lex;
|
||||
lex->select=lex->last_select=select_lex;
|
||||
select_lex->table_list.next= (byte**) &select_lex->table_list.first;
|
||||
select_lex->item_list.empty();
|
||||
select_lex->when_list.empty();
|
||||
@ -3052,8 +3065,8 @@ static void remove_escape(char *name)
|
||||
#ifdef USE_MB
|
||||
int l;
|
||||
/* if ((l = ismbchar(name, name+MBMAXLEN))) { Wei He: I think it's wrong */
|
||||
if (use_mb(default_charset_info) &&
|
||||
(l = my_ismbchar(default_charset_info, name, strend)))
|
||||
if (use_mb(system_charset_info) &&
|
||||
(l = my_ismbchar(system_charset_info, name, strend)))
|
||||
{
|
||||
while (l--)
|
||||
*to++ = *name++;
|
||||
@ -3107,7 +3120,7 @@ TABLE_LIST *add_table_to_list(Table_ident *table, LEX_STRING *alias,
|
||||
DBUG_RETURN(0); // End of memory
|
||||
alias_str= alias ? alias->str : table->table.str;
|
||||
if (table->table.length > NAME_LEN ||
|
||||
check_table_name(table->table.str,table->table.length) ||
|
||||
(table->table.length && check_table_name(table->table.str,table->table.length)) ||
|
||||
table->db.str && check_db_name(table->db.str))
|
||||
{
|
||||
net_printf(&thd->net,ER_WRONG_TABLE_NAME,table->table.str);
|
||||
@ -3139,13 +3152,14 @@ TABLE_LIST *add_table_to_list(Table_ident *table, LEX_STRING *alias,
|
||||
ptr->name=alias_str;
|
||||
if (lower_case_table_names)
|
||||
{
|
||||
casedn_str(ptr->db);
|
||||
casedn_str(table->table.str);
|
||||
my_casedn_str(system_charset_info,ptr->db);
|
||||
my_casedn_str(system_charset_info,table->table.str);
|
||||
}
|
||||
ptr->real_name=table->table.str;
|
||||
ptr->real_name_length=table->table.length;
|
||||
ptr->lock_type=flags;
|
||||
ptr->updating=updating;
|
||||
ptr->derived=(SELECT_LEX *)table->sel;
|
||||
if (use_index)
|
||||
ptr->use_index=(List<String> *) thd->memdup((gptr) use_index,
|
||||
sizeof(*use_index));
|
||||
|
Reference in New Issue
Block a user