summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-04-24 10:37:21 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-04-24 10:37:21 +0300
commitc425d93b92acbf00f03a339c117616d2308669b6 (patch)
treeb58de458933e1473a8d0701a709082be81a00079 /sql/item.h
parente3a25793be936d9682a711a00d6b4bf708b6fb8d (diff)
parent14a18d7d7f6293ad0e106288eab4fdcb3a72ebd9 (diff)
downloadmariadb-git-c425d93b92acbf00f03a339c117616d2308669b6.tar.gz
Merge 10.2 into 10.3
except commit 1288dfffe77a99d6c5906d12010a1677ee149308
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/sql/item.h b/sql/item.h
index af4043a218a..a9598ca29c6 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1772,6 +1772,15 @@ public:
return 0;
}
+ /**
+ Check db/table_name if they defined in item and match arg values
+
+ @param arg Pointer to Check_table_name_prm structure
+
+ @retval true Match failed
+ @retval false Match succeeded
+ */
+ virtual bool check_table_name_processor(void *arg) { return false; }
/*
TRUE if the expression depends only on the table indicated by tab_map
or can be converted to such an exression using equalities.
@@ -1904,6 +1913,15 @@ public:
bool collect;
};
+ struct Check_table_name_prm
+ {
+ LEX_CSTRING db;
+ LEX_CSTRING table_name;
+ String field;
+ Check_table_name_prm(LEX_CSTRING _db, LEX_CSTRING _table_name) :
+ db(_db), table_name(_table_name) {}
+ };
+
/*
For SP local variable returns pointer to Item representing its
current value and pointer to current Item otherwise.
@@ -3177,6 +3195,24 @@ public:
}
return 0;
}
+ bool check_table_name_processor(void *arg)
+ {
+ Check_table_name_prm &p= *(Check_table_name_prm *) arg;
+ if (p.table_name.length && table_name)
+ {
+ DBUG_ASSERT(p.db.length);
+ if ((db_name &&
+ my_strcasecmp(table_alias_charset, p.db.str, db_name)) ||
+ my_strcasecmp(table_alias_charset, p.table_name.str, table_name))
+ {
+ print(&p.field, (enum_query_type) (QT_ITEM_ORIGINAL_FUNC_NULLIF |
+ QT_NO_DATA_EXPANSION |
+ QT_TO_SYSTEM_CHARSET));
+ return true;
+ }
+ }
+ return false;
+ }
void cleanup();
Item_equal *get_item_equal() { return item_equal; }
void set_item_equal(Item_equal *item_eq) { item_equal= item_eq; }