From f8ff8fc6def43682145ed95ae5429f84918b9ae3 Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Wed, 27 Nov 2002 17:04:43 +0200 Subject: after review changes in IN/ALL/ANY/SOME (SCRUM) --- sql/sql_base.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'sql/sql_base.cc') diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 09b29c6b41d..8aa33a65ce3 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -743,6 +743,29 @@ void close_temporary_tables(THD *thd) thd->temporary_tables=0; } +/* + Find first suitable table in given list. + + SYNOPSIS + find_table_in_list() + table - pointer to table list + db_name - data base name or 0 for any + table_name - table name or 0 for any + + RETURN VALUES + NULL Table not found + # Pointer to found table. +*/ + +TABLE_LIST * find_table_in_list(TABLE_LIST *table, + const char *db_name, const char *table_name) +{ + for (; table; table= table->next) + if ((!db_name || !strcmp(table->db, db_name)) && + (!table_name || !strcmp(table->alias, table_name))) + break; + return table; +} TABLE **find_temporary_table(THD *thd, const char *db, const char *table_name) { -- cgit v1.2.1