Commit 2bf93a8f authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.3 into 10.4

parents 6b5f7ddc 294ac1fb
......@@ -5723,7 +5723,7 @@ static bool xtrabackup_prepare_func(char** argv)
error_cleanup:
xb_filters_free();
return ok;
return ok && !ib::error::was_logged();
}
/**************************************************************************
......
......@@ -5472,6 +5472,23 @@ drop procedure p;
drop view v1;
drop table t1;
#
# MDEV-22591 Debug build crashes on EXECUTE IMMEDIATE '... WHERE ?' USING IGNORE
#
CREATE TABLE t1 (a INT);
EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE ?' USING IGNORE;
ERROR HY000: Default/ignore value is not supported for such parameter usage
EXECUTE IMMEDIATE 'SELECT * FROM t1 HAVING ?' USING IGNORE;
ERROR HY000: Default/ignore value is not supported for such parameter usage
EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE ?' USING 0;
a
EXECUTE IMMEDIATE 'SELECT * FROM t1 HAVING ?' USING 0;
a
DROP TABLE t1;
EXECUTE IMMEDIATE 'SHOW DATABASES WHERE ?' USING DEFAULT;
ERROR HY000: Default/ignore value is not supported for such parameter usage
EXECUTE IMMEDIATE 'SHOW DATABASES WHERE ?' USING 0;
Database
#
# End of 10.2 tests
#
#
......
......@@ -4914,6 +4914,23 @@ drop procedure p;
drop view v1;
drop table t1;
--echo #
--echo # MDEV-22591 Debug build crashes on EXECUTE IMMEDIATE '... WHERE ?' USING IGNORE
--echo #
CREATE TABLE t1 (a INT);
--error ER_INVALID_DEFAULT_PARAM
EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE ?' USING IGNORE;
--error ER_INVALID_DEFAULT_PARAM
EXECUTE IMMEDIATE 'SELECT * FROM t1 HAVING ?' USING IGNORE;
EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE ?' USING 0;
EXECUTE IMMEDIATE 'SELECT * FROM t1 HAVING ?' USING 0;
DROP TABLE t1;
--error ER_INVALID_DEFAULT_PARAM
EXECUTE IMMEDIATE 'SHOW DATABASES WHERE ?' USING DEFAULT;
EXECUTE IMMEDIATE 'SHOW DATABASES WHERE ?' USING 0;
--echo #
--echo # End of 10.2 tests
--echo #
......
CREATE DATABASE test1;
CREATE PROCEDURE test1.sp3() BEGIN END;
SHOW PROCEDURE STATUS;
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
mtr add_suppression PROCEDURE root@localhost # # DEFINER utf8 utf8_general_ci latin1_swedish_ci
mtr check_testcase PROCEDURE root@localhost # # DEFINER utf8 utf8_general_ci latin1_swedish_ci
mtr check_warnings PROCEDURE root@localhost # # DEFINER utf8 utf8_general_ci latin1_swedish_ci
mysql AddGeometryColumn PROCEDURE mariadb.sys@localhost # # INVOKER latin1 latin1_swedish_ci latin1_swedish_ci
mysql DropGeometryColumn PROCEDURE mariadb.sys@localhost # # INVOKER latin1 latin1_swedish_ci latin1_swedish_ci
test sp2 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
test1 sp1 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
test1 sp3 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE sp2;
DROP DATABASE test1;
select count(*) from mysql.event;
count(*)
416
flush tables;
show events;
truncate table mysql.event;
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -20,5 +20,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
SET @binlog_fragment_0='012345';
BINLOG @binlog_fragment_0, @binlog_fragment_not_exist;
ERROR 42000: Incorrect argument type to variable 'binlog_fragment_not_exist'
SET @a= '42';
BINLOG @a, @a;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use
# Cleanup
DROP TABLE t;
......@@ -41,6 +41,11 @@ SET @binlog_fragment_0='012345';
--error ER_WRONG_TYPE_FOR_VAR
BINLOG @binlog_fragment_0, @binlog_fragment_not_exist;
# MDEV-22520
SET @a= '42';
--error ER_SYNTAX_ERROR
BINLOG @a, @a;
--echo # Cleanup
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
DROP TABLE t;
......@@ -158,8 +158,9 @@ int binlog_defragment(THD *thd)
memcpy(const_cast<char*>(thd->lex->comment.str) + gathered_length, entry[k]->value,
entry[k]->length);
gathered_length += entry[k]->length;
update_hash(entry[k], true, NULL, 0, STRING_RESULT, &my_charset_bin, 0);
}
for (uint k=0; k < 2; k++)
update_hash(entry[k], true, NULL, 0, STRING_RESULT, &my_charset_bin, 0);
DBUG_ASSERT(gathered_length == thd->lex->comment.length);
......
......@@ -1970,7 +1970,9 @@ dict_index_remove_from_cache_low(
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(mutex_own(&dict_sys.mutex));
ut_ad(table->id);
#ifdef BTR_CUR_HASH_ADAPT
ut_ad(!index->freed());
#endif /* BTR_CUR_HASH_ADAPT */
/* No need to acquire the dict_index_t::lock here because
there can't be any active operations on this index (or table). */
......
......@@ -1056,16 +1056,12 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
@return whether the table will be rebuilt */
bool need_rebuild () const { return(old_table != new_table); }
/** Clear uncommmitted added indexes after a failed operation. */
void clear_added_indexes()
{
for (ulint i = 0; i < num_to_add_index; i++) {
if (!add_index[i]->is_committed()) {
add_index[i]->detach_columns();
add_index[i]->n_fields = 0;
}
}
}
/** Clear uncommmitted added indexes after a failed operation. */
void clear_added_indexes()
{
for (ulint i= 0; i < num_to_add_index; i++)
add_index[i]->detach_columns(true);
}
/** Convert table-rebuilding ALTER to instant ALTER. */
void prepare_instant()
......
This diff is collapsed.
......@@ -411,6 +411,14 @@ class error : public logger {
public:
ATTRIBUTE_COLD
~error();
/** Indicates that error::~error() was invoked. Can be used to
determine if error messages were logged during innodb code execution.
@return true if there were error messages, false otherwise. */
static bool was_logged() { return logged; }
private:
/** true if error::~error() was invoked, false otherwise */
static bool logged;
};
/** The class fatal is used to emit an error message and stop the server
......
......@@ -6314,7 +6314,7 @@ static my_bool lock_table_locks_lookup(rw_trx_hash_element_t *element,
ut_ad(lock->trx == element->trx);
if (lock_get_type_low(lock) == LOCK_REC)
{
ut_ad(!dict_index_is_online_ddl(lock->index) ||
ut_ad(lock->index->online_status != ONLINE_INDEX_CREATION ||
lock->index->is_primary());
ut_ad(lock->index->table != table);
}
......
......@@ -2121,14 +2121,14 @@ AIO::linux_create_io_ctx(
}
/* Have tried enough. Better call it a day. */
ib::error()
ib::warn()
<< "io_setup() failed with EAGAIN after "
<< OS_AIO_IO_SETUP_RETRY_ATTEMPTS
<< " attempts.";
break;
case -ENOSYS:
ib::error()
ib::warn()
<< "Linux Native AIO interface"
" is not supported on this platform. Please"
" check your OS documentation and install"
......@@ -2137,7 +2137,7 @@ AIO::linux_create_io_ctx(
break;
default:
ib::error()
ib::warn()
<< "Linux Native AIO setup"
<< " returned following error["
<< ret << "]";
......
......@@ -1290,10 +1290,6 @@ void
row_sel_open_pcur(
/*==============*/
plan_t* plan, /*!< in: table plan */
#ifdef BTR_CUR_HASH_ADAPT
rw_lock_t* ahi_latch,
/*!< in: the adaptive hash index latch */
#endif /* BTR_CUR_HASH_ADAPT */
mtr_t* mtr) /*!< in/out: mini-transaction */
{
dict_index_t* index;
......@@ -1337,7 +1333,7 @@ row_sel_open_pcur(
btr_pcur_open_with_no_init(index, plan->tuple, plan->mode,
BTR_SEARCH_LEAF, &plan->pcur,
ahi_latch, mtr);
NULL, mtr);
} else {
/* Open the cursor to the start or the end of the index
(FALSE: no init) */
......@@ -1482,16 +1478,12 @@ row_sel_try_search_shortcut(
ut_ad(plan->unique_search);
ut_ad(!plan->must_get_clust);
rw_lock_t* ahi_latch = btr_get_search_latch(index);
rw_lock_s_lock(ahi_latch);
row_sel_open_pcur(plan, ahi_latch, mtr);
row_sel_open_pcur(plan, mtr);
const rec_t* rec = btr_pcur_get_rec(&(plan->pcur));
if (!page_rec_is_user_rec(rec) || rec_is_metadata(rec, *index)) {
retry:
rw_lock_s_unlock(ahi_latch);
return(SEL_RETRY);
}
......@@ -1503,7 +1495,6 @@ row_sel_try_search_shortcut(
if (btr_pcur_get_up_match(&(plan->pcur)) < plan->n_exact_match) {
exhausted:
rw_lock_s_unlock(ahi_latch);
return(SEL_EXHAUSTED);
}
......@@ -1549,7 +1540,6 @@ row_sel_try_search_shortcut(
ut_ad(plan->pcur.latch_mode == BTR_SEARCH_LEAF);
plan->n_rows_fetched++;
rw_lock_s_unlock(ahi_latch);
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
......@@ -1671,11 +1661,7 @@ row_sel(
if (!plan->pcur_is_open) {
/* Evaluate the expressions to build the search tuple and
open the cursor */
row_sel_open_pcur(plan,
#ifdef BTR_CUR_HASH_ADAPT
NULL,
#endif /* BTR_CUR_HASH_ADAPT */
&mtr);
row_sel_open_pcur(plan, &mtr);
cursor_just_opened = TRUE;
......
......@@ -576,9 +576,13 @@ warn::~warn()
sql_print_warning("InnoDB: %s", m_oss.str().c_str());
}
/** true if error::~error() was invoked, false otherwise */
bool error::logged;
error::~error()
{
sql_print_error("InnoDB: %s", m_oss.str().c_str());
logged = true;
}
#ifdef _MSC_VER
......
......@@ -1288,6 +1288,7 @@ static my_bool allocate_head(MARIA_FILE_BITMAP *bitmap, uint size,
uint byte= 6 * (last_insert_page / 16);
first_pattern= last_insert_page % 16;
data= bitmap->map+byte;
first_found= 0; /* Don't update full_head_size */
DBUG_ASSERT(data <= end);
}
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment