summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-12-13 16:58:58 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-12-13 16:58:58 +0200
commita8a5c8a1b8ac566241d43a85de90c11f5d1568d9 (patch)
treef619f2a7ed54abbc9edd42b77f5b63caa6ec65ac /sql/item.cc
parent04efe13501246e490932d4be7bca90e207e0b5e2 (diff)
parent1dc2f35598193fc52b79061c286b61f01c617374 (diff)
downloadmariadb-git-a8a5c8a1b8ac566241d43a85de90c11f5d1568d9.tar.gz
Merge 10.5 into 10.6
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc33
1 files changed, 27 insertions, 6 deletions
diff --git a/sql/item.cc b/sql/item.cc
index a63ac1f1119..fdeafddc860 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);
}
@@ -7217,6 +7219,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'"));