summaryrefslogtreecommitdiff
path: root/sql/sql_handler.cc
diff options
context:
space:
mode:
authormonty@donna.mysql.fi <>2001-05-23 23:47:08 +0300
committermonty@donna.mysql.fi <>2001-05-23 23:47:08 +0300
commit02f007436f68a50945aa05f5b880b0bd2e7ab4d3 (patch)
treed871d522f4bdb89a0c46ec4f8d1428c0bafdbcc2 /sql/sql_handler.cc
parent8685094e159f29f2b00642f579be4ca681a10247 (diff)
downloadmariadb-git-02f007436f68a50945aa05f5b880b0bd2e7ab4d3.tar.gz
Added Unique class to be used for duplicate removal in multi-table delete.
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r--sql/sql_handler.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 3da9b96786d..a605984aef7 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -43,7 +43,8 @@
thd->open_tables=thd->handler_tables; \
thd->handler_tables=tmp; }
-static TABLE **find_table_ptr_by_name(THD *thd, char *db, char *table_name);
+static TABLE **find_table_ptr_by_name(THD *thd, const char *db,
+ const char *table_name);
int mysql_ha_open(THD *thd, TABLE_LIST *tables)
{
@@ -231,14 +232,15 @@ err:
/* Note: this function differs from find_locked_table() because we're looking
here for alias, not real table name
*/
-static TABLE **find_table_ptr_by_name(THD *thd, char *db, char *table_name)
+static TABLE **find_table_ptr_by_name(THD *thd, const char *db,
+ const char *table_name)
{
int dblen;
TABLE **ptr;
- if (!db || ! *db) db=thd->db;
- if (!db || ! *db) db="";
- dblen=strlen(db);
+ if (!db || ! *db)
+ db= thd->db ? thd->db : "";
+ dblen=strlen(db)+1;
ptr=&(thd->handler_tables);
for (TABLE *table=*ptr; table ; table=*ptr)