diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2016-08-12 11:17:45 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2016-09-02 13:22:28 +0300 |
commit | 2e814d4702d71a04388386a9f591d14a35980bfe (patch) | |
tree | f3f9b48d116a3738c5e71f3a360ca61f16cfb632 /storage/innobase/eval | |
parent | 848d211c5c4df00b819cd84d7530cf7d29bb0524 (diff) | |
download | mariadb-git-2e814d4702d71a04388386a9f591d14a35980bfe.tar.gz |
Merge InnoDB 5.7 from mysql-5.7.9.
Contains also
MDEV-10547: Test multi_update_innodb fails with InnoDB 5.7
The failure happened because 5.7 has changed the signature of
the bool handler::primary_key_is_clustered() const
virtual function ("const" was added). InnoDB was using the old
signature which caused the function not to be used.
MDEV-10550: Parallel replication lock waits/deadlock handling does not work with InnoDB 5.7
Fixed mutexing problem on lock_trx_handle_wait. Note that
rpl_parallel and rpl_optimistic_parallel tests still
fail.
MDEV-10156 : Group commit tests fail on 10.2 InnoDB (branch bb-10.2-jan)
Reason: incorrect merge
MDEV-10550: Parallel replication can't sync with master in InnoDB 5.7 (branch bb-10.2-jan)
Reason: incorrect merge
Diffstat (limited to 'storage/innobase/eval')
-rw-r--r-- | storage/innobase/eval/eval0eval.cc | 140 | ||||
-rw-r--r-- | storage/innobase/eval/eval0proc.cc | 20 |
2 files changed, 57 insertions, 103 deletions
diff --git a/storage/innobase/eval/eval0eval.cc b/storage/innobase/eval/eval0eval.cc index ccc54781102..a525cb604ea 100644 --- a/storage/innobase/eval/eval0eval.cc +++ b/storage/innobase/eval/eval0eval.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -60,8 +60,7 @@ NOTE that this memory must be explicitly freed when the query graph is freed. If the node already has an allocated buffer, that buffer is freed here. NOTE that this is the only function where dynamic memory should be allocated for a query node val field. -@return pointer to allocated buffer */ -UNIV_INTERN +@return pointer to allocated buffer */ byte* eval_node_alloc_val_buf( /*====================*/ @@ -80,14 +79,14 @@ eval_node_alloc_val_buf( data = static_cast<byte*>(dfield_get_data(dfield)); - if (data && data != &eval_dummy) { - mem_free(data); + if (data != &eval_dummy) { + ut_free(data); } if (size == 0) { data = &eval_dummy; } else { - data = static_cast<byte*>(mem_alloc(size)); + data = static_cast<byte*>(ut_malloc_nokey(size)); } que_node_set_val_buf_size(node, size); @@ -101,7 +100,6 @@ eval_node_alloc_val_buf( Free the buffer from global dynamic memory for a value of a que_node, if it has been allocated in the above function. The freeing for pushed column values is done in sel_col_prefetch_buf_free. */ -UNIV_INTERN void eval_node_free_val_buf( /*===================*/ @@ -120,7 +118,7 @@ eval_node_free_val_buf( if (que_node_get_val_buf_size(node) > 0) { ut_a(data); - mem_free(data); + ut_free(data); } } @@ -135,12 +133,9 @@ eval_cmp_like( que_node_t* arg2) /* !< in: right operand */ { ib_like_t op; - int res; que_node_t* arg3; que_node_t* arg4; - dfield_t* dfield; - dtype_t* dtype; - ibool val = TRUE; + const dfield_t* dfield; arg3 = que_node_get_like_node(arg2); @@ -148,51 +143,23 @@ eval_cmp_like( ut_a(arg3); dfield = que_node_get_val(arg3); - dtype = dfield_get_type(dfield); - - ut_a(dtype_get_mtype(dtype) == DATA_INT); - op = static_cast<ib_like_t>(mach_read_from_4(static_cast<const unsigned char*>(dfield_get_data(dfield)))); + ut_ad(dtype_get_mtype(dfield_get_type(dfield)) == DATA_INT); + op = static_cast<ib_like_t>( + mach_read_from_4(static_cast<const byte*>( + dfield_get_data(dfield)))); switch (op) { - case IB_LIKE_PREFIX: - - arg4 = que_node_get_next(arg3); - res = cmp_dfield_dfield_like_prefix( - que_node_get_val(arg1), - que_node_get_val(arg4)); - break; - - case IB_LIKE_SUFFIX: - - arg4 = que_node_get_next(arg3); - res = cmp_dfield_dfield_like_suffix( - que_node_get_val(arg1), - que_node_get_val(arg4)); - break; - - case IB_LIKE_SUBSTR: - + case IB_LIKE_PREFIX: arg4 = que_node_get_next(arg3); - res = cmp_dfield_dfield_like_substr( - que_node_get_val(arg1), - que_node_get_val(arg4)); - break; - - case IB_LIKE_EXACT: - res = cmp_dfield_dfield( - que_node_get_val(arg1), - que_node_get_val(arg2)); - break; - - default: - ut_error; - } - - if (res != 0) { - val = FALSE; + return(!cmp_dfield_dfield_like_prefix(que_node_get_val(arg1), + que_node_get_val(arg4))); + case IB_LIKE_EXACT: + return(!cmp_dfield_dfield(que_node_get_val(arg1), + que_node_get_val(arg2))); } - return(val); + ut_error; + return(FALSE); } /********************************************************************* @@ -206,53 +173,47 @@ eval_cmp( que_node_t* arg1; que_node_t* arg2; int res; - int func; - ibool val = TRUE; + ibool val = FALSE; /* remove warning */ ut_ad(que_node_get_type(cmp_node) == QUE_NODE_FUNC); arg1 = cmp_node->args; arg2 = que_node_get_next(arg1); - func = cmp_node->func; - - if (func == PARS_LIKE_TOKEN_EXACT - || func == PARS_LIKE_TOKEN_PREFIX - || func == PARS_LIKE_TOKEN_SUFFIX - || func == PARS_LIKE_TOKEN_SUBSTR) { - - val = eval_cmp_like(arg1, arg2); - } else { + switch (cmp_node->func) { + case '<': + case '=': + case '>': + case PARS_LE_TOKEN: + case PARS_NE_TOKEN: + case PARS_GE_TOKEN: res = cmp_dfield_dfield( que_node_get_val(arg1), que_node_get_val(arg2)); - if (func == '=') { - if (res != 0) { - val = FALSE; - } - } else if (func == '<') { - if (res != -1) { - val = FALSE; - } - } else if (func == PARS_LE_TOKEN) { - if (res == 1) { - val = FALSE; - } - } else if (func == PARS_NE_TOKEN) { - if (res == 0) { - val = FALSE; - } - } else if (func == PARS_GE_TOKEN) { - if (res == -1) { - val = FALSE; - } - } else { - ut_ad(func == '>'); - - if (res != 1) { - val = FALSE; - } + switch (cmp_node->func) { + case '<': + val = (res < 0); + break; + case '=': + val = (res == 0); + break; + case '>': + val = (res > 0); + break; + case PARS_LE_TOKEN: + val = (res <= 0); + break; + case PARS_NE_TOKEN: + val = (res != 0); + break; + case PARS_GE_TOKEN: + val = (res >= 0); + break; } + break; + default: + val = eval_cmp_like(arg1, arg2); + break; } eval_node_set_ibool_val(cmp_node, val); @@ -870,7 +831,6 @@ eval_predefined( /*****************************************************************//** Evaluates a function node. */ -UNIV_INTERN void eval_func( /*======*/ diff --git a/storage/innobase/eval/eval0proc.cc b/storage/innobase/eval/eval0proc.cc index e6f3a32cd48..cdd6fdc2a0a 100644 --- a/storage/innobase/eval/eval0proc.cc +++ b/storage/innobase/eval/eval0proc.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1998, 2011, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1998, 2014, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -31,8 +31,7 @@ Created 1/20/1998 Heikki Tuuri /**********************************************************************//** Performs an execution step of an if-statement node. -@return query thread to run next or NULL */ -UNIV_INTERN +@return query thread to run next or NULL */ que_thr_t* if_step( /*====*/ @@ -108,8 +107,7 @@ if_step( /**********************************************************************//** Performs an execution step of a while-statement node. -@return query thread to run next or NULL */ -UNIV_INTERN +@return query thread to run next or NULL */ que_thr_t* while_step( /*=======*/ @@ -144,8 +142,7 @@ while_step( /**********************************************************************//** Performs an execution step of an assignment statement node. -@return query thread to run next or NULL */ -UNIV_INTERN +@return query thread to run next or NULL */ que_thr_t* assign_step( /*========*/ @@ -171,8 +168,7 @@ assign_step( /**********************************************************************//** Performs an execution step of a for-loop node. -@return query thread to run next or NULL */ -UNIV_INTERN +@return query thread to run next or NULL */ que_thr_t* for_step( /*=====*/ @@ -233,8 +229,7 @@ for_step( /**********************************************************************//** Performs an execution step of an exit statement node. -@return query thread to run next or NULL */ -UNIV_INTERN +@return query thread to run next or NULL */ que_thr_t* exit_step( /*======*/ @@ -265,8 +260,7 @@ exit_step( /**********************************************************************//** Performs an execution step of a return-statement node. -@return query thread to run next or NULL */ -UNIV_INTERN +@return query thread to run next or NULL */ que_thr_t* return_step( /*========*/ |