diff options
author | monty@mysql.com <> | 2004-10-07 12:51:32 +0300 |
---|---|---|
committer | monty@mysql.com <> | 2004-10-07 12:51:32 +0300 |
commit | 1dd4bd5f6cd2f7bbbc3f01ae0758173b889f3024 (patch) | |
tree | c40a3078a450f8748d8f07f48bdbf35e59d7f9a0 /sql/sql_handler.cc | |
parent | 01232b2c521e7715502197421f56f7294ed5a4ef (diff) | |
parent | 9954abef020742904080c9e69e4789a362ac04f5 (diff) | |
download | mariadb-git-1dd4bd5f6cd2f7bbbc3f01ae0758173b889f3024.tar.gz |
Merge mysql.com:/home/my/mysql-4.0 into mysql.com:/home/my/mysql-4.1
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r-- | sql/sql_handler.cc | 66 |
1 files changed, 31 insertions, 35 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 33537d1080a..ffd64134182 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -71,7 +71,7 @@ static enum enum_ha_read_modes rkey_to_rnext[]= thd->open_tables=thd->handler_tables; \ thd->handler_tables=tmp; } -static int mysql_ha_flush_table(THD *thd, TABLE **table_ptr, int mode_flags); +static int mysql_ha_flush_table(THD *thd, TABLE **table_ptr, uint mode_flags); /* @@ -151,8 +151,9 @@ int mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen) uint dblen, namelen, aliaslen, counter; int err; DBUG_ENTER("mysql_ha_open"); - DBUG_PRINT("enter",("mysql_ha_open: '%s'.'%s' as '%s' reopen %d", - tables->db, tables->real_name, tables->alias, reopen)); + DBUG_PRINT("enter",("'%s'.'%s' as '%s' reopen: %d", + tables->db, tables->real_name, tables->alias, + (int) reopen)); if (! hash_inited(&thd->handler_tables_hash)) { @@ -170,7 +171,7 @@ int mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen) if (hash_search(&thd->handler_tables_hash, (byte*) tables->alias, strlen(tables->alias) + 1)) { - DBUG_PRINT("info",("mysql_ha_open: duplicate '%s'", tables->alias)); + DBUG_PRINT("info",("duplicate '%s'", tables->alias)); if (! reopen) my_printf_error(ER_NONUNIQ_TABLE, ER(ER_NONUNIQ_TABLE), MYF(0), tables->alias); @@ -210,10 +211,7 @@ int mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen) &name, namelen, &alias, aliaslen, NullS))) - { - DBUG_PRINT("exit",("mysql_ha_open: malloc ERROR")); goto err; - } /* structure copy */ *hash_tables= *tables; hash_tables->db= db; @@ -233,11 +231,11 @@ int mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen) if (! reopen) send_ok(thd); - DBUG_PRINT("exit",("mysql_ha_open: OK")); + DBUG_PRINT("exit",("OK")); DBUG_RETURN(0); err: - DBUG_PRINT("exit",("mysql_ha_open: ERROR")); + DBUG_PRINT("exit",("ERROR")); DBUG_RETURN(-1); } @@ -266,7 +264,7 @@ int mysql_ha_close(THD *thd, TABLE_LIST *tables) bool was_flushed= FALSE; bool not_opened; DBUG_ENTER("mysql_ha_close"); - DBUG_PRINT("enter",("mysql_ha_close: '%s'.'%s' as '%s'", + DBUG_PRINT("enter",("'%s'.'%s' as '%s'", tables->db, tables->real_name, tables->alias)); if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash, @@ -286,7 +284,7 @@ int mysql_ha_close(THD *thd, TABLE_LIST *tables) #if MYSQL_VERSION_ID < 40100 if (*tables->db && strcmp(hash_tables->db, tables->db)) { - DBUG_PRINT("info",("mysql_ha_close: wrong db")); + DBUG_PRINT("info",("wrong db")); hash_tables= NULL; } else @@ -322,12 +320,12 @@ int mysql_ha_close(THD *thd, TABLE_LIST *tables) my_printf_error(ER_UNKNOWN_TABLE, ER(ER_UNKNOWN_TABLE), MYF(0), tables->alias, "HANDLER"); #endif - DBUG_PRINT("exit",("mysql_ha_close: ERROR")); + DBUG_PRINT("exit",("ERROR")); DBUG_RETURN(-1); } send_ok(thd); - DBUG_PRINT("exit",("mysql_ha_close: OK")); + DBUG_PRINT("exit", ("OK")); DBUG_RETURN(0); } @@ -370,7 +368,7 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, uint key_len; bool was_flushed; DBUG_ENTER("mysql_ha_read"); - DBUG_PRINT("enter",("mysql_ha_read: '%s'.'%s' as '%s'", + DBUG_PRINT("enter",("'%s'.'%s' as '%s'", tables->db, tables->real_name, tables->alias)); LINT_INIT(key); @@ -385,9 +383,9 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, strlen(tables->alias) + 1))) { table= hash_tables->table; - DBUG_PRINT("info",("mysql_ha_read: found in hash '%s'.'%s' as '%s' tab %p", - hash_tables->db, hash_tables->real_name, - hash_tables->alias, table)); + DBUG_PRINT("info-in-hash",("'%s'.'%s' as '%s' tab %p", + hash_tables->db, hash_tables->real_name, + hash_tables->alias, table)); if (!table) { /* @@ -395,12 +393,12 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, */ if (mysql_ha_open(thd, hash_tables, 1)) { - DBUG_PRINT("exit",("mysql_ha_read: reopen failed")); + DBUG_PRINT("exit",("reopen failed")); goto err0; } table= hash_tables->table; - DBUG_PRINT("info",("mysql_ha_read: re-opened '%s'.'%s' as '%s' tab %p", + DBUG_PRINT("info",("re-opened '%s'.'%s' as '%s' tab %p", hash_tables->db, hash_tables->real_name, hash_tables->alias, table)); } @@ -408,7 +406,7 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, #if MYSQL_VERSION_ID < 40100 if (*tables->db && strcmp(table->table_cache_key, tables->db)) { - DBUG_PRINT("info",("mysql_ha_read: wrong db")); + DBUG_PRINT("info",("wrong db")); table= NULL; } #endif @@ -584,12 +582,13 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, ok: mysql_unlock_tables(thd,lock); send_eof(thd); - DBUG_PRINT("exit",("mysql_ha_read: OK")); + DBUG_PRINT("exit",("OK")); DBUG_RETURN(0); + err: mysql_unlock_tables(thd,lock); err0: - DBUG_PRINT("exit",("mysql_ha_read: ERROR")); + DBUG_PRINT("exit",("ERROR")); DBUG_RETURN(-1); } @@ -623,24 +622,23 @@ err0: 0 ok */ -int mysql_ha_flush(THD *thd, TABLE_LIST *tables, int mode_flags) +int mysql_ha_flush(THD *thd, TABLE_LIST *tables, uint mode_flags) { TABLE_LIST **tmp_tables_p; TABLE_LIST *tmp_tables; TABLE **table_ptr; bool was_flushed; DBUG_ENTER("mysql_ha_flush"); - DBUG_PRINT("enter",("mysql_ha_flush: tables %p mode_flags 0x%02x", - tables, mode_flags)); + DBUG_PRINT("enter", ("tables: %p mode_flags: 0x%02x", tables, mode_flags)); if (tables) { /* Close all tables in the list. */ for (tmp_tables= tables ; tmp_tables; tmp_tables= tmp_tables->next) { - DBUG_PRINT("info",("mysql_ha_flush: in tables list '%s'.'%s' as '%s'", - tmp_tables->db, tmp_tables->real_name, - tmp_tables->alias)); + DBUG_PRINT("info-in-tables-list",("'%s'.'%s' as '%s'", + tmp_tables->db, tmp_tables->real_name, + tmp_tables->alias)); /* Close all currently open handler tables with the same base table. */ table_ptr= &(thd->handler_tables); while (*table_ptr) @@ -651,7 +649,7 @@ int mysql_ha_flush(THD *thd, TABLE_LIST *tables, int mode_flags) ! my_strcasecmp(&my_charset_latin1, (*table_ptr)->real_name, tmp_tables->real_name)) { - DBUG_PRINT("info",("mysql_ha_flush: *table_ptr '%s'.'%s' as '%s'", + DBUG_PRINT("info",("*table_ptr '%s'.'%s' as '%s'", (*table_ptr)->table_cache_key, (*table_ptr)->real_name, (*table_ptr)->table_name)); @@ -680,7 +678,6 @@ int mysql_ha_flush(THD *thd, TABLE_LIST *tables, int mode_flags) } } - DBUG_PRINT("exit",("mysql_ha_flush: OK")); DBUG_RETURN(0); } @@ -702,15 +699,15 @@ int mysql_ha_flush(THD *thd, TABLE_LIST *tables, int mode_flags) 0 ok */ -static int mysql_ha_flush_table(THD *thd, TABLE **table_ptr, int mode_flags) +static int mysql_ha_flush_table(THD *thd, TABLE **table_ptr, uint mode_flags) { TABLE_LIST *hash_tables; TABLE *table= *table_ptr; bool was_flushed; DBUG_ENTER("mysql_ha_flush_table"); - DBUG_PRINT("info",("mysql_ha_flush_table: '%s'.'%s' as '%s' flags 0x%02x", - table->table_cache_key, table->real_name, - table->table_name, mode_flags)); + DBUG_PRINT("enter",("'%s'.'%s' as '%s' flags: 0x%02x", + table->table_cache_key, table->real_name, + table->table_name, mode_flags)); if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash, (*table_ptr)->table_name, @@ -735,6 +732,5 @@ static int mysql_ha_flush_table(THD *thd, TABLE **table_ptr, int mode_flags) VOID(pthread_cond_broadcast(&COND_refresh)); } - DBUG_PRINT("exit",("mysql_ha_flush_table: OK")); DBUG_RETURN(0); } |