Commit f6de082b authored by unknown's avatar unknown

Merge mysql.com:/home/jimw/my/mysql-4.1-clean

into  mysql.com:/home/jimw/my/mysql-5.0-clean


myisam/myisampack.c:
  Auto merged
mysql-test/r/metadata.result:
  Auto merged
mysys/list.c:
  Auto merged
mysys/thr_lock.c:
  Auto merged
sql-common/client.c:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_test.cc:
  Auto merged
sql/mysqld.cc:
  SCCS merged
parents 219c84fa 000a09ba
...@@ -36,7 +36,7 @@ extern void list_free(LIST *root,unsigned int free_data); ...@@ -36,7 +36,7 @@ extern void list_free(LIST *root,unsigned int free_data);
extern unsigned int list_length(LIST *); extern unsigned int list_length(LIST *);
extern int list_walk(LIST *,list_walk_action action,gptr argument); extern int list_walk(LIST *,list_walk_action action,gptr argument);
#define rest(a) ((a)->next) #define list_rest(a) ((a)->next)
#define list_push(a,b) (a)=list_cons((b),(a)) #define list_push(a,b) (a)=list_cons((b),(a))
#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; my_free((gptr) old,MYF(MY_FAE)); } #define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; my_free((gptr) old,MYF(MY_FAE)); }
......
...@@ -695,14 +695,22 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table) ...@@ -695,14 +695,22 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
else else
error=my_rename(new_name,org_name,MYF(MY_WME)); error=my_rename(new_name,org_name,MYF(MY_WME));
if (!error) if (!error)
{
VOID(my_copystat(temp_name,org_name,MYF(MY_COPYTIME))); VOID(my_copystat(temp_name,org_name,MYF(MY_COPYTIME)));
if (tmp_dir[0])
VOID(my_delete(new_name,MYF(MY_WME)));
}
} }
} }
else else
{ {
if (tmp_dir[0]) if (tmp_dir[0])
{
error=my_copy(new_name,org_name, error=my_copy(new_name,org_name,
MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_COPYTIME)); MYF(MY_WME | MY_HOLD_ORIGINAL_MODES | MY_COPYTIME));
if (!error)
VOID(my_delete(new_name,MYF(MY_WME)));
}
else else
error=my_redel(org_name,new_name,MYF(MY_WME | MY_COPYTIME)); error=my_redel(org_name,new_name,MYF(MY_WME | MY_COPYTIME));
} }
......
...@@ -85,3 +85,14 @@ def aaa 1 1 8 20 1 N 32769 0 63 ...@@ -85,3 +85,14 @@ def aaa 1 1 8 20 1 N 32769 0 63
1 1
1 1
drop table t1; drop table t1;
create table t1 (i int);
insert into t1 values (1),(2),(3);
select * from t1 where i = 2;
drop table t1;//
affected rows: 0
affected rows: 3
info: Records: 3 Duplicates: 0 Warnings: 0
i
2
affected rows: 1
affected rows: 0
...@@ -49,4 +49,16 @@ drop table t1; ...@@ -49,4 +49,16 @@ drop table t1;
--disable_metadata --disable_metadata
#
# Bug #11688: Bad mysql_info() results in multi-results
#
--enable_info
delimiter //;
create table t1 (i int);
insert into t1 values (1),(2),(3);
select * from t1 where i = 2;
drop table t1;//
delimiter ;//
--disable_info
# End of 4.1 tests # End of 4.1 tests
...@@ -109,7 +109,7 @@ int list_walk(LIST *list, list_walk_action action, gptr argument) ...@@ -109,7 +109,7 @@ int list_walk(LIST *list, list_walk_action action, gptr argument)
{ {
if ((error = (*action)(list->data,argument))) if ((error = (*action)(list->data,argument)))
return error; return error;
list=rest(list); list=list_rest(list);
} }
return 0; return 0;
} }
...@@ -1206,7 +1206,8 @@ void thr_print_locks(void) ...@@ -1206,7 +1206,8 @@ void thr_print_locks(void)
pthread_mutex_lock(&THR_LOCK_lock); pthread_mutex_lock(&THR_LOCK_lock);
puts("Current locks:"); puts("Current locks:");
for (list=thr_lock_thread_list ; list && count++ < MAX_THREADS ; list=rest(list)) for (list= thr_lock_thread_list; list && count++ < MAX_THREADS;
list= list_rest(list))
{ {
THR_LOCK *lock=(THR_LOCK*) list->data; THR_LOCK *lock=(THR_LOCK*) list->data;
VOID(pthread_mutex_lock(&lock->mutex)); VOID(pthread_mutex_lock(&lock->mutex));
......
...@@ -713,8 +713,9 @@ void free_old_query(MYSQL *mysql) ...@@ -713,8 +713,9 @@ void free_old_query(MYSQL *mysql)
if (mysql->fields) if (mysql->fields)
free_root(&mysql->field_alloc,MYF(0)); free_root(&mysql->field_alloc,MYF(0));
init_alloc_root(&mysql->field_alloc,8192,0); /* Assume rowlength < 8192 */ init_alloc_root(&mysql->field_alloc,8192,0); /* Assume rowlength < 8192 */
mysql->fields=0; mysql->fields= 0;
mysql->field_count=0; /* For API */ mysql->field_count= 0; /* For API */
mysql->info= 0;
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
......
...@@ -714,7 +714,6 @@ static void close_connections(void) ...@@ -714,7 +714,6 @@ static void close_connections(void)
} }
#endif #endif
end_thr_alarm(0); // Abort old alarms. end_thr_alarm(0); // Abort old alarms.
end_slave();
/* /*
First signal all threads that it's time to die First signal all threads that it's time to die
...@@ -730,6 +729,9 @@ static void close_connections(void) ...@@ -730,6 +729,9 @@ static void close_connections(void)
{ {
DBUG_PRINT("quit",("Informing thread %ld that it's time to die", DBUG_PRINT("quit",("Informing thread %ld that it's time to die",
tmp->thread_id)); tmp->thread_id));
/* We skip slave threads on this first loop through. */
if (tmp->slave_thread) continue;
tmp->killed= THD::KILL_CONNECTION; tmp->killed= THD::KILL_CONNECTION;
if (tmp->mysys_var) if (tmp->mysys_var)
{ {
...@@ -746,6 +748,8 @@ static void close_connections(void) ...@@ -746,6 +748,8 @@ static void close_connections(void)
} }
(void) pthread_mutex_unlock(&LOCK_thread_count); // For unlink from list (void) pthread_mutex_unlock(&LOCK_thread_count); // For unlink from list
end_slave();
if (thread_count) if (thread_count)
sleep(2); // Give threads time to die sleep(2); // Give threads time to die
......
...@@ -2328,16 +2328,11 @@ mysql_execute_command(THD *thd) ...@@ -2328,16 +2328,11 @@ mysql_execute_command(THD *thd)
/* /*
Skip if we are in the slave thread, some table rules have been 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. given and the table list says the query should not be replicated.
Exception is DROP TEMPORARY TABLE IF EXISTS: we always execute it
Exceptions are: (otherwise we have stale files on slave caused by exclusion of one tmp
table).
- SET: we always execute it (e.g., SET ONE_SHOT TIME_ZONE = 'XYZ')
- DROP TEMPORARY TABLE IF EXISTS: we always execute it (otherwise we
have stale files on slave caused by exclusion of one tmp table).
*/ */
if (lex->sql_command != SQLCOM_SET_OPTION && if (!(lex->sql_command == SQLCOM_DROP_TABLE &&
!(lex->sql_command == SQLCOM_DROP_TABLE &&
lex->drop_temporary && lex->drop_if_exists) && lex->drop_temporary && lex->drop_if_exists) &&
all_tables_not_ok(thd, all_tables)) all_tables_not_ok(thd, all_tables))
{ {
......
...@@ -370,7 +370,7 @@ static void display_table_locks(void) ...@@ -370,7 +370,7 @@ static void display_table_locks(void)
VOID(my_init_dynamic_array(&saved_table_locks,sizeof(TABLE_LOCK_INFO),open_cache.records + 20,50)); VOID(my_init_dynamic_array(&saved_table_locks,sizeof(TABLE_LOCK_INFO),open_cache.records + 20,50));
VOID(pthread_mutex_lock(&THR_LOCK_lock)); VOID(pthread_mutex_lock(&THR_LOCK_lock));
for (list=thr_lock_thread_list ; list ; list=rest(list)) for (list= thr_lock_thread_list; list; list= list_rest(list))
{ {
THR_LOCK *lock=(THR_LOCK*) list->data; THR_LOCK *lock=(THR_LOCK*) list->data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment