mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
Add QT_ITEM_IDENT_DISABLE_DB_TABLE_NAMES flag for Item::print
It allows to skip db and table name when printing table column references.
This commit is contained in:
parent
16d8d18907
commit
68cba09173
2 changed files with 12 additions and 0 deletions
|
@ -3193,6 +3193,12 @@ void Item_ident::print(String *str, enum_query_type query_type)
|
|||
use_db_name= use_table_name= false;
|
||||
}
|
||||
|
||||
if ((query_type & QT_ITEM_IDENT_DISABLE_DB_TABLE_NAMES))
|
||||
{
|
||||
// Don't print db or table name irrespective of any other settings.
|
||||
use_db_name= use_table_name= false;
|
||||
}
|
||||
|
||||
if (!field_name.str || !field_name.str[0])
|
||||
{
|
||||
append_identifier(thd, str, STRING_WITH_LEN("tmp_field"));
|
||||
|
|
|
@ -871,6 +871,12 @@ enum enum_query_type
|
|||
QT_ITEM_SUBSELECT_ID_ONLY,
|
||||
|
||||
QT_SHOW_SELECT_NUMBER= (1<<10),
|
||||
|
||||
/// Do not print database name or table name in the identifiers (even if
|
||||
/// this means the printout will be ambigous). It is assumed that the caller
|
||||
/// passing this flag knows what they are doing.
|
||||
QT_ITEM_IDENT_DISABLE_DB_TABLE_NAMES= (1 <<11),
|
||||
|
||||
/// This is used for EXPLAIN EXTENDED extra warnings / Be more detailed
|
||||
/// Be more detailed than QT_EXPLAIN.
|
||||
/// Perhaps we should eventually include QT_ITEM_IDENT_SKIP_CURRENT_DATABASE
|
||||
|
|
Loading…
Reference in a new issue