diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-12-13 18:24:51 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-12-13 18:24:51 +0200 |
commit | b7914f562da0d4bce7c1c26b119e7063594be974 (patch) | |
tree | df85f229a896cf3e6b24ebc34063b078774b3834 /sql/item.cc | |
parent | 21ef68d52e13ec146dab6cf54e0d3eca87306d58 (diff) | |
parent | d7a4ce3c804334914b2431e91d6328945dce6b02 (diff) | |
download | mariadb-git-b7914f562da0d4bce7c1c26b119e7063594be974.tar.gz |
Merge 10.8 into 10.9
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/sql/item.cc b/sql/item.cc index bb6657ab416..10a8127d06f 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1586,12 +1586,14 @@ bool Item_field::check_vcol_func_processor(void *arg) } } } - if (field && (field->unireg_check == Field::NEXT_NUMBER)) - { - // Auto increment fields are unsupported - return mark_unsupported_function(field_name.str, arg, VCOL_FIELD_REF | VCOL_AUTO_INC); - } - return mark_unsupported_function(field_name.str, arg, VCOL_FIELD_REF); + + uint r= VCOL_FIELD_REF; + if (field && field->unireg_check == Field::NEXT_NUMBER) + r|= VCOL_AUTO_INC; + if (field && field->vcol_info && + field->vcol_info->flags & (VCOL_NOT_STRICTLY_DETERMINISTIC | VCOL_AUTO_INC)) + r|= VCOL_NON_DETERMINISTIC; + return mark_unsupported_function(field_name.str, arg, r); } @@ -7245,6 +7247,25 @@ Item_bin_string::Item_bin_string(THD *thd, const char *str, size_t str_length): } +void Item_bin_string::print(String *str, enum_query_type query_type) +{ + if (!str_value.length()) + { + /* + Historically a bit string such as b'01100001' + prints itself in the hex hybrid notation: 0x61 + In case of an empty bit string b'', the hex hybrid + notation would result in a bad syntax: 0x + So let's print empty bit strings using bit string notation: b'' + */ + static const LEX_CSTRING empty_bit_string= {STRING_WITH_LEN("b''")}; + str->append(empty_bit_string); + } + else + Item_hex_hybrid::print(str, query_type); +} + + void Item_date_literal::print(String *str, enum_query_type query_type) { str->append(STRING_WITH_LEN("DATE'")); |