Commit f2a53539 authored by Kentoku SHIBA's avatar Kentoku SHIBA

find temporary table

parent 27772bd7
...@@ -8563,8 +8563,10 @@ int spider_db_udf_direct_sql( ...@@ -8563,8 +8563,10 @@ int spider_db_udf_direct_sql(
} }
#if MYSQL_VERSION_ID < 50500 #if MYSQL_VERSION_ID < 50500
#else #else
if (table->pos_in_table_list) if (
{ table->s->tmp_table == NO_TMP_TABLE &&
table->pos_in_table_list
) {
TABLE_LIST *next_tables = TABLE_LIST *next_tables =
table->pos_in_table_list->next_global; table->pos_in_table_list->next_global;
while (next_tables && next_tables->parent_l) while (next_tables && next_tables->parent_l)
...@@ -8651,8 +8653,10 @@ int spider_db_udf_direct_sql( ...@@ -8651,8 +8653,10 @@ int spider_db_udf_direct_sql(
table->file->ha_external_lock(table->in_use, F_UNLCK); table->file->ha_external_lock(table->in_use, F_UNLCK);
#if MYSQL_VERSION_ID < 50500 #if MYSQL_VERSION_ID < 50500
#else #else
if (table->pos_in_table_list) if (
{ table->s->tmp_table == NO_TMP_TABLE &&
table->pos_in_table_list
) {
TABLE_LIST *next_tables = TABLE_LIST *next_tables =
table->pos_in_table_list->next_global; table->pos_in_table_list->next_global;
while (next_tables && next_tables->parent_l) while (next_tables && next_tables->parent_l)
......
...@@ -40,6 +40,10 @@ ...@@ -40,6 +40,10 @@
#include "spd_udf.h" #include "spd_udf.h"
#include "spd_malloc.h" #include "spd_malloc.h"
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100004
#define SPIDER_NEED_INIT_ONE_TABLE_FOR_FIND_TEMPORARY_TABLE
#endif
extern const char **spd_defaults_extra_file; extern const char **spd_defaults_extra_file;
extern const char **spd_defaults_file; extern const char **spd_defaults_file;
...@@ -1604,8 +1608,16 @@ long long spider_direct_sql_body( ...@@ -1604,8 +1608,16 @@ long long spider_direct_sql_body(
#endif #endif
for (roop_count = 0; roop_count < direct_sql->table_count; roop_count++) for (roop_count = 0; roop_count < direct_sql->table_count; roop_count++)
{ {
#ifdef SPIDER_NEED_INIT_ONE_TABLE_FOR_FIND_TEMPORARY_TABLE
table_list.init_one_table(direct_sql->db_names[roop_count],
strlen(direct_sql->db_names[roop_count]),
direct_sql->table_names[roop_count],
strlen(direct_sql->table_names[roop_count]),
direct_sql->table_names[roop_count], TL_WRITE);
#else
table_list.db = direct_sql->db_names[roop_count]; table_list.db = direct_sql->db_names[roop_count];
table_list.table_name = direct_sql->table_names[roop_count]; table_list.table_name = direct_sql->table_names[roop_count];
#endif
if (!(direct_sql->tables[roop_count] = if (!(direct_sql->tables[roop_count] =
find_temporary_table(thd, &table_list))) find_temporary_table(thd, &table_list)))
{ {
......
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