Commit 1a264ceb authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi

Reverted Heikkis patch as his was not portable.

Remove not needed locks in SHOW OPEN TABLES
parent 3f48e036
...@@ -267,35 +267,6 @@ innobase_mysql_print_thd( ...@@ -267,35 +267,6 @@ innobase_mysql_print_thd(
thd = (THD*) input_thd; thd = (THD*) input_thd;
buf += sprintf(buf, "MySQL thread id %lu, query id %lu",
thd->thread_id, thd->query_id);
if (thd->host) {
buf += sprintf(buf, " %.30s", thd->host);
}
if (thd->ip) {
buf += sprintf(buf, " %.20s", thd->ip);
}
if (thd->user) {
buf += sprintf(buf, " %.20s", thd->user);
}
if (thd->proc_info) {
buf += sprintf(buf, " %.50s", thd->proc_info);
}
if (thd->query) {
buf += sprintf(buf, "\n%.150s", thd->query);
}
buf += sprintf(buf, "\n");
#ifdef notdefined
/* July 30, 2002
Revert Monty's changes because they seem to make control
characters sometimes appear in the output */
/* We can't use value of sprintf() as this is not portable */ /* We can't use value of sprintf() as this is not portable */
buf+= my_sprintf(buf, buf+= my_sprintf(buf,
(buf, "MySQL thread id %lu", (buf, "MySQL thread id %lu",
...@@ -330,7 +301,6 @@ innobase_mysql_print_thd( ...@@ -330,7 +301,6 @@ innobase_mysql_print_thd(
buf=strnmov(buf, thd->query, 150); buf=strnmov(buf, thd->query, 150);
} }
*buf='\n'; *buf='\n';
#endif
} }
} }
...@@ -478,8 +448,7 @@ innobase_init(void) ...@@ -478,8 +448,7 @@ innobase_init(void)
&srv_auto_extend_last_data_file, &srv_auto_extend_last_data_file,
&srv_last_file_size_max); &srv_last_file_size_max);
if (ret == FALSE) { if (ret == FALSE) {
fprintf(stderr, sql_print_error("InnoDB: syntax error in innodb_data_file_path");
"InnoDB: syntax error in innodb_data_file_path\n");
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
...@@ -925,12 +894,12 @@ ha_innobase::open( ...@@ -925,12 +894,12 @@ ha_innobase::open(
norm_name, NULL); norm_name, NULL);
if (NULL == ib_table) { if (NULL == ib_table) {
fprintf(stderr, sql_print_error("InnoDB error:\n\
"InnoDB: Error: cannot find table %s from the internal data dictionary\n" Cannot find table %s from the internal data dictionary\n\
"InnoDB: of InnoDB though the .frm file for the table exists. Maybe you\n" of InnoDB though the .frm file for the table exists. Maybe you\n\
"InnoDB: have deleted and recreated InnoDB data files but have forgotten\n" have deleted and recreated InnoDB data files but have forgotten\n\
"InnoDB: to delete the corresponding .frm files of InnoDB tables, or you\n" to delete the corresponding .frm files of InnoDB tables, or you\n\
"InnoDB: have moved .frm files to another database?\n", have moved .frm files to another database?",
norm_name); norm_name);
free_share(share); free_share(share);
...@@ -1269,7 +1238,6 @@ ha_innobase::store_key_val_for_row( ...@@ -1269,7 +1238,6 @@ ha_innobase::store_key_val_for_row(
equal */ equal */
bzero(buff, (ref_length - (uint) (buff - buff_start))); bzero(buff, (ref_length - (uint) (buff - buff_start)));
DBUG_RETURN(ref_length); DBUG_RETURN(ref_length);
} }
...@@ -2124,10 +2092,7 @@ ha_innobase::change_active_index( ...@@ -2124,10 +2092,7 @@ ha_innobase::change_active_index(
} }
if (!prebuilt->index) { if (!prebuilt->index) {
fprintf(stderr, sql_print_error("Innodb could not find key n:o %u with name %s from dict cache for table %s", keynr, key ? key->name : "NULL", prebuilt->table->name);
"InnoDB: Could not find key n:o %u with name %s from dict cache\n"
"InnoDB: for table %s\n", keynr, key ? key->name : "NULL", prebuilt->table->name);
DBUG_RETURN(1); DBUG_RETURN(1);
} }
...@@ -2425,6 +2390,7 @@ ha_innobase::rnd_pos( ...@@ -2425,6 +2390,7 @@ ha_innobase::rnd_pos(
} }
if (error) { if (error) {
DBUG_PRINT("error",("Got error: %ld",error));
DBUG_RETURN(error); DBUG_RETURN(error);
} }
...@@ -2432,6 +2398,10 @@ ha_innobase::rnd_pos( ...@@ -2432,6 +2398,10 @@ ha_innobase::rnd_pos(
for the table, and it is == ref_length */ for the table, and it is == ref_length */
error = index_read(buf, pos, ref_length, HA_READ_KEY_EXACT); error = index_read(buf, pos, ref_length, HA_READ_KEY_EXACT);
if (error)
{
DBUG_PRINT("error",("Got error: %ld",error));
}
change_active_index(keynr); change_active_index(keynr);
...@@ -2442,7 +2412,6 @@ ha_innobase::rnd_pos( ...@@ -2442,7 +2412,6 @@ ha_innobase::rnd_pos(
Stores a reference to the current row to 'ref' field of the handle. Note Stores a reference to the current row to 'ref' field of the handle. Note
that in the case where we have generated the clustered index for the that in the case where we have generated the clustered index for the
table, the function parameter is illogical: we MUST ASSUME that 'record' table, the function parameter is illogical: we MUST ASSUME that 'record'
is the current 'position' of the handle, because if row ref is actually
the row id internally generated in InnoDB, then 'record' does not contain the row id internally generated in InnoDB, then 'record' does not contain
it. We just guess that the row id must be for the record where the handle it. We just guess that the row id must be for the record where the handle
was positioned the last time. */ was positioned the last time. */
...@@ -2691,7 +2660,7 @@ ha_innobase::create( ...@@ -2691,7 +2660,7 @@ ha_innobase::create(
/* Our function row_get_mysql_key_number_for_index assumes /* Our function row_get_mysql_key_number_for_index assumes
the primary key is always number 0, if it exists */ the primary key is always number 0, if it exists */
assert(primary_key_no == -1 || primary_key_no == 0); DBUG_ASSERT(primary_key_no == -1 || primary_key_no == 0);
/* Create the keys */ /* Create the keys */
...@@ -2772,7 +2741,7 @@ ha_innobase::create( ...@@ -2772,7 +2741,7 @@ ha_innobase::create(
innobase_table = dict_table_get(norm_name, NULL); innobase_table = dict_table_get(norm_name, NULL);
assert(innobase_table != 0); DBUG_ASSERT(innobase_table != 0);
/* Tell the InnoDB server that there might be work for /* Tell the InnoDB server that there might be work for
utility threads: */ utility threads: */
......
...@@ -117,7 +117,6 @@ int mysqld_show_open_tables(THD *thd,const char *db,const char *wild) ...@@ -117,7 +117,6 @@ int mysqld_show_open_tables(THD *thd,const char *db,const char *wild)
if (list_open_tables(thd,&tables,db,wild)) if (list_open_tables(thd,&tables,db,wild))
DBUG_RETURN(-1); DBUG_RETURN(-1);
pthread_mutex_lock(&LOCK_open);
List_iterator<char> it(tables); List_iterator<char> it(tables);
while ((table_name=it++)) while ((table_name=it++))
{ {
...@@ -126,11 +125,9 @@ int mysqld_show_open_tables(THD *thd,const char *db,const char *wild) ...@@ -126,11 +125,9 @@ int mysqld_show_open_tables(THD *thd,const char *db,const char *wild)
net_store_data(&thd->packet,query_table_status(thd,db,table_name)); net_store_data(&thd->packet,query_table_status(thd,db,table_name));
if (my_net_write(&thd->net,(char*) thd->packet.ptr(),thd->packet.length())) if (my_net_write(&thd->net,(char*) thd->packet.ptr(),thd->packet.length()))
{ {
pthread_mutex_unlock(&LOCK_open);
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
} }
pthread_mutex_unlock(&LOCK_open);
send_eof(&thd->net); send_eof(&thd->net);
DBUG_RETURN(0); DBUG_RETURN(0);
} }
......
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