diff options
| author | Oleksandr Byelkin <sanja@mariadb.com> | 2023-05-02 13:54:54 +0200 |
|---|---|---|
| committer | Oleksandr Byelkin <sanja@mariadb.com> | 2023-05-02 13:54:54 +0200 |
| commit | edf8ce5b9741520cd5b3e559af2dd7cace6b4af9 (patch) | |
| tree | 20ce88b147bc64be1ab6206714d6fbcd3f40c530 /sql/sql_schema.cc | |
| parent | d821fd7fab2723b84f774aaa4882acb86b35769d (diff) | |
| parent | edd0b03e60f4cc666fbdf16e7b01b97188f2f887 (diff) | |
| download | mariadb-git-edf8ce5b9741520cd5b3e559af2dd7cace6b4af9.tar.gz | |
Merge branch 'bb-10.4-release' into bb-10.5-release
Diffstat (limited to 'sql/sql_schema.cc')
| -rw-r--r-- | sql/sql_schema.cc | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/sql/sql_schema.cc b/sql/sql_schema.cc index 0bf4a63c2f8..f08204d272d 100644 --- a/sql/sql_schema.cc +++ b/sql/sql_schema.cc @@ -32,6 +32,14 @@ public: return thd->type_handler_for_datetime(); return src; } + + Item *make_item_func_replace(THD *thd, + Item *subj, + Item *find, + Item *replace) const; + Item *make_item_func_substr(THD *thd, + const Lex_substring_spec_st &spec) const; + Item *make_item_func_trim(THD *thd, const Lex_trim_st &spec) const; }; @@ -78,3 +86,56 @@ Schema *Schema::find_implied(THD *thd) return &maxdb_schema; return &mariadb_schema; } + + +Item *Schema::make_item_func_replace(THD *thd, + Item *subj, + Item *find, + Item *replace) const +{ + return new (thd->mem_root) Item_func_replace(thd, subj, find, replace); +} + + +Item *Schema::make_item_func_substr(THD *thd, + const Lex_substring_spec_st &spec) const +{ + return spec.m_for ? + new (thd->mem_root) Item_func_substr(thd, spec.m_subject, spec.m_from, + spec.m_for) : + new (thd->mem_root) Item_func_substr(thd, spec.m_subject, spec.m_from); +} + + +Item *Schema::make_item_func_trim(THD *thd, const Lex_trim_st &spec) const +{ + return spec.make_item_func_trim_std(thd); +} + + +Item *Schema_oracle::make_item_func_replace(THD *thd, + Item *subj, + Item *find, + Item *replace) const +{ + return new (thd->mem_root) Item_func_replace_oracle(thd, subj, find, replace); +} + + +Item *Schema_oracle::make_item_func_substr(THD *thd, + const Lex_substring_spec_st &spec) const +{ + return spec.m_for ? + new (thd->mem_root) Item_func_substr_oracle(thd, spec.m_subject, + spec.m_from, + spec.m_for) : + new (thd->mem_root) Item_func_substr_oracle(thd, spec.m_subject, + spec.m_from); +} + + +Item *Schema_oracle::make_item_func_trim(THD *thd, + const Lex_trim_st &spec) const +{ + return spec.make_item_func_trim_oracle(thd); +} |
