diff options
author | Sinisa@sinisa.nasamreza.org <> | 2002-11-29 14:49:07 +0200 |
---|---|---|
committer | Sinisa@sinisa.nasamreza.org <> | 2002-11-29 14:49:07 +0200 |
commit | 481bcd57505787f5adb6df6a78e017116b9bede6 (patch) | |
tree | 2296c7002f19725e5df14900abb3708b44f792fc /sql | |
parent | 8a53d1ca6a3e1e3d93953aeb699e964bb9941c65 (diff) | |
download | mariadb-git-481bcd57505787f5adb6df6a78e017116b9bede6.tar.gz |
many bug fixes
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_base.cc | 4 | ||||
-rw-r--r-- | sql/sql_derived.cc | 4 | ||||
-rw-r--r-- | sql/sql_lex.cc | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 8aa33a65ce3..ff4b75b275a 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1894,13 +1894,13 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables, const char *name=item->field_name; uint length=(uint) strlen(name); - if (table_name) + if (table_name && table_name[0]) { /* Qualified field */ bool found_table=0; for (; tables ; tables=tables->next) { if (!strcmp(tables->alias,table_name) && - (!db || !strcmp(db,tables->db))) + (!db || !tables->db || !tables->db[0] || !strcmp(db,tables->db))) { found_table=1; Field *find=find_field_in_table(thd,tables->table,name,length, diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 01e2c1a98d8..2176740e67b 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -106,9 +106,9 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t) t->table=table; table->derived_select_number= sl->select_number; table->tmp_table=TMP_TABLE; - if (!lex->describe) + if (lex->describe) sl->exclude(); - t->db=(tables && tables->db) ? tables->db : (char *)""; + t->db=(char *)""; t->derived=(SELECT_LEX *)0; // just in case ... } } diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 5104487c700..e850626948f 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1173,6 +1173,8 @@ bool st_select_lex_unit::create_total_list_n_last_return(THD *thd, st_lex *lex, net_printf(thd,ER_WRONG_USAGE,"UNION","ORDER BY"); return 1; } + if (sl->linkage == DERIVED_TABLE_TYPE) + continue; for (SELECT_LEX_UNIT *inner= sl->first_inner_unit(); inner; inner= inner->next_unit()) |