mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Remove warnings and portability fixes
New global read lock code Fixed bug in DATETIME with WHERE optimization Made UNION code more general. include/global.h: Remove warning on Linux Alpha include/mysql_com.h: Move some C variables inside extern "C" block. include/mysqld_error.h: New error mesages myisam/mi_write.c: cleanup mysql-test/r/select.result: Fix because of table lists now always has a database argument. mysql-test/r/type_datetime.result: Test for bug with datetime and where optimization mysql-test/r/union.result: Updated result mysql-test/t/type_datetime.test: New test for datetime mysql-test/t/union.test: More testing of error conditions sql/item_sum.cc: Remove warnings on Linux Alpha sql/item_sum.h: Cleanup sql/lock.cc: Cleaned up global lock handling sql/log_event.cc: Removed default arguments from declarations (not allowed in cxx) sql/mysql_priv.h: New prototypes sql/mysqld.cc: Fix for global locks sql/opt_range.cc: Cleanup sql/share/czech/errmsg.txt: New errors sql/share/danish/errmsg.txt: New errors sql/share/dutch/errmsg.txt: New errors sql/share/english/errmsg.txt: New errors sql/share/estonian/errmsg.txt: New errors sql/share/french/errmsg.txt: New errors sql/share/german/errmsg.txt: New errors sql/share/greek/errmsg.txt: New errors sql/share/hungarian/errmsg.txt: New errors sql/share/italian/errmsg.txt: New errors sql/share/japanese/errmsg.txt: New errors sql/share/korean/errmsg.txt: New errors sql/share/norwegian-ny/errmsg.txt: New errors sql/share/norwegian/errmsg.txt: New errors sql/share/polish/errmsg.txt: New errors sql/share/portuguese/errmsg.txt: New errors sql/share/romanian/errmsg.txt: New errors sql/share/russian/errmsg.txt: New errors sql/share/slovak/errmsg.txt: New errors sql/share/spanish/errmsg.txt: New errors sql/share/swedish/errmsg.OLD: New errors sql/share/swedish/errmsg.txt: New errors sql/sql_acl.cc: Use thd->host_or_ip sql/sql_class.cc: Use new global lock code sql/sql_class.h: host_or_ip sql/sql_db.cc: host_or_ip sql/sql_delete.cc: Use now global lock code sql/sql_lex.h: Cleanup of not used states and variables sql/sql_parse.cc: Use now global locks. Made UNION code more general. Change to use thd->hosts_or_ip. TABLE_LIST now always has 'db' set. sql/sql_repl.cc: Portability fixes. Changed wrong usage of my_vsnprintf -> my_snprintf sql/sql_select.cc: Changes for UNION sql/sql_show.cc: Cleanup sql/sql_union.cc: Handle 'select_result' outside of mysql_union(). sql/sql_yacc.yy: Fixes for union
This commit is contained in:
@@ -35,26 +35,10 @@ int generate_table(THD *thd, TABLE_LIST *table_list, TABLE *locked_table)
|
||||
TABLE **table_ptr;
|
||||
DBUG_ENTER("generate_table");
|
||||
|
||||
if (wait_if_global_read_lock(thd,0))
|
||||
DBUG_RETURN(1);
|
||||
thd->proc_info="generate_table";
|
||||
|
||||
if (global_read_lock)
|
||||
{
|
||||
if(thd->global_read_lock)
|
||||
{
|
||||
my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE,MYF(0),
|
||||
table_list->real_name);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
pthread_mutex_lock(&LOCK_open);
|
||||
while (global_read_lock && ! thd->killed ||
|
||||
thd->version != refresh_version)
|
||||
{
|
||||
(void) pthread_cond_wait(&COND_refresh,&LOCK_open);
|
||||
}
|
||||
pthread_mutex_unlock(&LOCK_open);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* If it is a temporary table, close and regenerate it */
|
||||
if ((table_ptr=find_temporary_table(thd,table_list->db,
|
||||
table_list->real_name)))
|
||||
@@ -91,6 +75,7 @@ int generate_table(THD *thd, TABLE_LIST *table_list, TABLE *locked_table)
|
||||
if (!locked_table)
|
||||
{
|
||||
VOID(pthread_mutex_unlock(&LOCK_open));
|
||||
start_waiting_global_read_lock(thd);
|
||||
DBUG_RETURN(1); // We must get a lock on table
|
||||
}
|
||||
}
|
||||
@@ -118,6 +103,7 @@ int generate_table(THD *thd, TABLE_LIST *table_list, TABLE *locked_table)
|
||||
}
|
||||
send_ok(&thd->net); // This should return record count
|
||||
}
|
||||
start_waiting_global_read_lock(thd);
|
||||
DBUG_RETURN(error ? -1 : 0);
|
||||
}
|
||||
|
||||
@@ -298,7 +284,7 @@ int mysql_delete(THD *thd,
|
||||
|
||||
int refposcmp2(void* arg, const void *a,const void *b)
|
||||
{
|
||||
return memcmp(a,b,(int) arg);
|
||||
return memcmp(a,b, *(int*) arg);
|
||||
}
|
||||
|
||||
multi_delete::multi_delete(THD *thd_arg, TABLE_LIST *dt,
|
||||
@@ -321,7 +307,7 @@ multi_delete::multi_delete(THD *thd_arg, TABLE_LIST *dt,
|
||||
(void) dt->table->file->extra(HA_EXTRA_NO_READCHECK);
|
||||
(void) dt->table->file->extra(HA_EXTRA_NO_KEYREAD);
|
||||
tempfiles[counter] = new Unique (refposcmp2,
|
||||
(void *) table->file->ref_length,
|
||||
(void *) &table->file->ref_length,
|
||||
table->file->ref_length,
|
||||
MEM_STRIP_BUF_SIZE);
|
||||
}
|
||||
|
Reference in New Issue
Block a user