8351
8351
@param tables list of tables in join
8352
8352
@query_type type of the query is being generated
8354
static void print_join(Session *session, String *str,
8355
List<TableList> *tables, enum_query_type)
8354
void print_join(Session *session, String *str,
8355
List<TableList> *tables, enum_query_type)
8357
8357
/* List is reversed => we should reverse it before using */
8358
8358
List_iterator_fast<TableList> ti(*tables);
8386
8386
print_table_array(session, str, table, table + tables->elements);
8390
Print table as it should be in join list.
8392
@param str string where table should be printed
8394
void TableList::print(Session *session, String *str, enum_query_type query_type)
8399
print_join(session, str, &nested_join->join_list, query_type);
8404
const char *cmp_name; // Name to compare with alias
8409
derived->print(str, query_type);
8411
cmp_name= ""; // Force printing of alias
8417
str->append_identifier(db, db_length);
8422
str->append_identifier(schema_table_name, strlen(schema_table_name));
8423
cmp_name= schema_table_name;
8427
str->append_identifier(table_name, table_name_length);
8428
cmp_name= table_name;
8431
if (my_strcasecmp(table_alias_charset, cmp_name, alias))
8434
if (alias && alias[0])
8438
string t_alias(alias);
8439
transform(t_alias.begin(), t_alias.end(),
8440
t_alias.begin(), ::tolower);
8442
str->append_identifier(t_alias.c_str(), t_alias.length());
8449
List_iterator<Index_hint> it(*index_hints);
8452
while ((hint= it++))
8454
str->append (STRING_WITH_LEN(" "));
8455
hint->print (session, str);
8461
8389
void Select_Lex::print(Session *session, String *str, enum_query_type query_type)
8463
8391
/* QQ: session may not be set for sub queries, but this should be fixed */