Commit a48380cd authored by unknown's avatar unknown

Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1

into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0


client/mysqlimport.c:
  Auto merged
include/config-netware.h:
  Auto merged
innobase/os/os0thread.c:
  Auto merged
netware/mysqld_safe.c:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/mysqld.cc:
  Merged from 4.1.
sql/sql_base.cc:
  Merged from 4.1.
sql/sql_handler.cc:
  Merged from 4.1.
sql/sql_select.cc:
  Merged from 4.1.
parents 26252fa2 1665d237
...@@ -95,6 +95,9 @@ extern "C" { ...@@ -95,6 +95,9 @@ extern "C" {
/* On NetWare, stack grows towards lower address*/ /* On NetWare, stack grows towards lower address*/
#define STACK_DIRECTION -1 #define STACK_DIRECTION -1
/* On NetWare, we need to set stack size for threads, otherwise default 16K is used */
#define NW_THD_STACKSIZE 65536
/* On NetWare, to fix the problem with the deletion of open files */ /* On NetWare, to fix the problem with the deletion of open files */
#define CANT_DELETE_OPEN_FILES 1 #define CANT_DELETE_OPEN_FILES 1
......
...@@ -147,6 +147,15 @@ os_thread_create( ...@@ -147,6 +147,15 @@ os_thread_create(
"InnoDB: Error: pthread_attr_setstacksize returned %d\n", ret); "InnoDB: Error: pthread_attr_setstacksize returned %d\n", ret);
exit(1); exit(1);
} }
#endif
#ifdef __NETWARE__
ret = pthread_attr_setstacksize(&attr,
(size_t) NW_THD_STACKSIZE);
if (ret) {
fprintf(stderr,
"InnoDB: Error: pthread_attr_setstacksize returned %d\n", ret);
exit(1);
}
#endif #endif
os_mutex_enter(os_sync_mutex); os_mutex_enter(os_sync_mutex);
os_thread_count++; os_thread_count++;
......
...@@ -258,11 +258,11 @@ void finish_defaults() ...@@ -258,11 +258,11 @@ void finish_defaults()
void read_defaults(arg_list_t *pal) void read_defaults(arg_list_t *pal)
{ {
arg_list_t al; arg_list_t al;
char defaults_file[PATH_MAX]; char defaults_file[PATH_MAX];
char mydefaults[PATH_MAX]; char mydefaults[PATH_MAX];
char line[PATH_MAX]; char line[PATH_MAX];
FILE *fp; FILE *fp;
// defaults output file // defaults output file
snprintf(defaults_file, PATH_MAX, "%s/bin/defaults.out", basedir); snprintf(defaults_file, PATH_MAX, "%s/bin/defaults.out", basedir);
remove(defaults_file); remove(defaults_file);
...@@ -270,7 +270,7 @@ void read_defaults(arg_list_t *pal) ...@@ -270,7 +270,7 @@ void read_defaults(arg_list_t *pal)
// mysqladmin file // mysqladmin file
snprintf(mydefaults, PATH_MAX, "%s/bin/my_print_defaults", basedir); snprintf(mydefaults, PATH_MAX, "%s/bin/my_print_defaults", basedir);
// args // args
init_args(&al); init_args(&al);
add_arg(&al, mydefaults); add_arg(&al, mydefaults);
if (default_option[0]) if (default_option[0])
...@@ -279,11 +279,11 @@ void read_defaults(arg_list_t *pal) ...@@ -279,11 +279,11 @@ void read_defaults(arg_list_t *pal)
add_arg(&al, "server"); add_arg(&al, "server");
add_arg(&al, "mysqld_safe"); add_arg(&al, "mysqld_safe");
add_arg(&al, "safe_mysqld"); add_arg(&al, "safe_mysqld");
spawn(mydefaults, &al, TRUE, NULL, defaults_file, NULL); spawn(mydefaults, &al, TRUE, NULL, defaults_file, NULL);
free_args(&al); free_args(&al);
// gather defaults // gather defaults
if ((fp= fopen(defaults_file, "r")) != NULL) if ((fp= fopen(defaults_file, "r")) != NULL)
{ {
......
...@@ -3322,6 +3322,11 @@ int main(int argc, char **argv) ...@@ -3322,6 +3322,11 @@ int main(int argc, char **argv)
} }
} }
#endif #endif
#ifdef __NETWARE__
/* Increasing stacksize of threads on NetWare */
pthread_attr_setstacksize(&connection_attrib, NW_THD_STACKSIZE);
#endif
(void) thr_setconcurrency(concurrency); // 10 by default (void) thr_setconcurrency(concurrency); // 10 by default
......
...@@ -1388,10 +1388,20 @@ TABLE *find_locked_table(THD *thd, const char *db,const char *table_name) ...@@ -1388,10 +1388,20 @@ TABLE *find_locked_table(THD *thd, const char *db,const char *table_name)
/**************************************************************************** /****************************************************************************
** Reopen an table because the definition has changed. The date file for the Reopen an table because the definition has changed. The date file for the
** table is already closed. table is already closed.
** Returns 0 if ok.
** If table can't be reopened, the entry is unchanged. SYNOPSIS
reopen_table()
table Table to be opened
locked 1 if we have already a lock on LOCK_open
NOTES
table->query_id will be 0 if table was reopened
RETURN
0 ok
1 error ('table' is unchanged if table couldn't be reopened)
****************************************************************************/ ****************************************************************************/
bool reopen_table(TABLE *table,bool locked) bool reopen_table(TABLE *table,bool locked)
...@@ -1464,8 +1474,10 @@ bool reopen_table(TABLE *table,bool locked) ...@@ -1464,8 +1474,10 @@ bool reopen_table(TABLE *table,bool locked)
(*field)->table_name= &table->alias; (*field)->table_name= &table->alias;
} }
for (key=0 ; key < table->s->keys ; key++) for (key=0 ; key < table->s->keys ; key++)
{
for (part=0 ; part < table->key_info[key].usable_key_parts ; part++) for (part=0 ; part < table->key_info[key].usable_key_parts ; part++)
table->key_info[key].key_part[part].field->table= table; table->key_info[key].key_part[part].field->table= table;
}
if (table->triggers) if (table->triggers)
table->triggers->set_table(table); table->triggers->set_table(table);
......
...@@ -423,7 +423,13 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables, ...@@ -423,7 +423,13 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
if (cond && ((!cond->fixed && if (cond && ((!cond->fixed &&
cond->fix_fields(thd, &cond)) || cond->check_cols(1))) cond->fix_fields(thd, &cond)) || cond->check_cols(1)))
goto err0; {
if (table->query_id != thd->query_id)
cond->cleanup(); // File was reopened
if ((!cond->fixed &&
cond->fix_fields(thd, tables, &cond)) || cond->check_cols(1))
goto err0;
}
if (keyname) if (keyname)
{ {
......
...@@ -8614,6 +8614,11 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, ...@@ -8614,6 +8614,11 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
have null have null
*/ */
hidden_null_count=null_count; hidden_null_count=null_count;
/*
We need to update hidden_field_count as we may have stored group
functions with constant arguments
*/
param->hidden_field_count= (uint) (reg_field - table->field);
null_count= 0; null_count= 0;
} }
} }
...@@ -8833,7 +8838,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, ...@@ -8833,7 +8838,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
} }
} }
if (distinct) if (distinct && field_count != param->hidden_field_count)
{ {
/* /*
Create an unique key or an unique constraint over all columns Create an unique key or an unique constraint over all columns
......
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