diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-08-12 11:47:16 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-08-12 12:02:23 +0200 |
commit | 0aa9b03393f515d7b07c3139756c2a9270501c97 (patch) | |
tree | 074514d29d2db5045db04fb838506b3eb5d456e9 /sql | |
parent | 655cba619d2e6556d4a7c6a3b9127f248bb8e5a0 (diff) | |
parent | 4cbf77e16ef9324acf85c01bc63023d62b821752 (diff) | |
download | mariadb-git-0aa9b03393f515d7b07c3139756c2a9270501c97.tar.gz |
Merge branch '10.2' into 10.3
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_jsonfunc.cc | 8 | ||||
-rw-r--r-- | sql/mysqld.cc | 2 | ||||
-rw-r--r-- | sql/opt_range.cc | 7 | ||||
-rw-r--r-- | sql/sql_acl.cc | 4 | ||||
-rw-r--r-- | sql/sql_class.h | 9 | ||||
-rw-r--r-- | sql/table.cc | 2 |
6 files changed, 16 insertions, 16 deletions
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index d1c15a0126e..2cda8b25a8a 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -479,7 +479,7 @@ String *Item_func_json_value::val_str(String *str) (const uchar *) js->ptr() + js->length()); str->length(0); - str->set_charset(&my_charset_utf8mb4_bin); + str->set_charset(collation.collation); path.cur_step= path.p.steps; continue_search: @@ -2387,8 +2387,9 @@ String *Item_func_json_insert::val_str(String *str) if ((null_value= args[0]->null_value)) return 0; - str->set_charset(js->charset()); - json_string_set_cs(&key_name, js->charset()); + str->set_charset(collation.collation); + tmp_js.set_charset(collation.collation); + json_string_set_cs(&key_name, collation.collation); for (n_arg=1, n_path=0; n_arg < arg_count; n_arg+=2, n_path++) { @@ -2602,7 +2603,6 @@ continue_point: json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), (const uchar *) js->ptr() + js->length()); str->length(0); - str->set_charset(js->charset()); if (json_nice(&je, str, Item_func_json_format::LOOSE)) goto js_error; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e689087e1f8..1a3ff53be6f 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -8321,7 +8321,7 @@ my_asn1_time_to_string(const ASN1_TIME *time, char *buf, size_t len) if (bio == NULL) return NULL; - if (!ASN1_TIME_print(bio, time)) + if (!ASN1_TIME_print(bio, const_cast<ASN1_TIME*>(time))) goto end; n_read= BIO_read(bio, buf, (int) (len - 1)); diff --git a/sql/opt_range.cc b/sql/opt_range.cc index d3f8acd8350..f10d6dbcfcc 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -7517,9 +7517,8 @@ SEL_TREE *Item_bool_func::get_full_func_mm_tree(RANGE_OPT_PARAM *param, param->current_table); #ifdef HAVE_SPATIAL Field::geometry_type sav_geom_type; - LINT_INIT_STRUCT(sav_geom_type); - - if (field_item->field->type() == MYSQL_TYPE_GEOMETRY) + const bool geometry= field_item->field->type() == MYSQL_TYPE_GEOMETRY; + if (geometry) { sav_geom_type= ((Field_geom*) field_item->field)->geom_type; /* We have to be able to store all sorts of spatial features here */ @@ -7554,7 +7553,7 @@ SEL_TREE *Item_bool_func::get_full_func_mm_tree(RANGE_OPT_PARAM *param, } #ifdef HAVE_SPATIAL - if (field_item->field->type() == MYSQL_TYPE_GEOMETRY) + if (geometry) { ((Field_geom*) field_item->field)->geom_type= sav_geom_type; } diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index a28dcd5addd..88d1630d94b 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3362,7 +3362,8 @@ int acl_set_default_role(THD *thd, const char *host, const char *user, ulong query_length= 0; bool clear_role= FALSE; char buff[512]; - enum_binlog_format save_binlog_format; + enum_binlog_format save_binlog_format= + thd->get_current_stmt_binlog_format(); const CSET_STRING query_save __attribute__((unused)) = thd->query_string; DBUG_ENTER("acl_set_default_role"); @@ -3402,6 +3403,7 @@ int acl_set_default_role(THD *thd, const char *host, const char *user, if (WSREP(thd) && !IF_WSREP(thd->wsrep_applier, 0)) { thd->set_query(buff, query_length, system_charset_info); + // Attention!!! here is implicit goto error; WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, (char*)"user", NULL); } diff --git a/sql/sql_class.h b/sql/sql_class.h index 359d5f93a1f..faae443e7a0 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -4035,6 +4035,10 @@ public: *format= (enum_binlog_format) variables.binlog_format; *current_format= current_stmt_binlog_format; } + inline enum_binlog_format get_current_stmt_binlog_format() + { + return current_stmt_binlog_format; + } inline void set_binlog_format(enum_binlog_format format, enum_binlog_format current_format) { @@ -4080,11 +4084,6 @@ public: DBUG_VOID_RETURN; } - inline enum_binlog_format get_current_stmt_binlog_format() - { - return current_stmt_binlog_format; - } - inline void set_current_stmt_binlog_format(enum_binlog_format format) { current_stmt_binlog_format= format; diff --git a/sql/table.cc b/sql/table.cc index d66df730467..627f6159979 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2143,7 +2143,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, keyinfo= share->key_info; uint primary_key= my_strcasecmp(system_charset_info, share->keynames.type_names[0], primary_key_name) ? MAX_KEY : 0; - KEY* key_first_info; + KEY* key_first_info= NULL; if (primary_key >= MAX_KEY && keyinfo->flags & HA_NOSAME) { |