Commit ca3bbf4c authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.5 into 10.6

parents bc75f7ed bf70532e
......@@ -30,9 +30,12 @@ then
# build is not running on Travis or Gitlab-CI
sed '/-DPLUGIN_COLUMNSTORE=NO/d' -i debian/rules
# Take the files and part of control from MCS directory
if [ ! -f debian/mariadb-plugin-columnstore.install ]
then
cp -v storage/columnstore/columnstore/debian/mariadb-plugin-columnstore.* debian/
echo >> debian/control
cat storage/columnstore/columnstore/debian/control >> debian/control
fi
fi
# Look up distro-version specific stuff
......@@ -128,6 +131,11 @@ case "${CODENAME}" in
exit 1
esac
if [ -n "${AUTOBAKE_PREP_CONTROL_RULES_ONLY:-}" ]
then
exit 0
fi
# Adjust changelog, add new version
echo "Incrementing changelog and starting build scripts"
......
......@@ -112,7 +112,7 @@ override_dh_auto_build:
@echo "RULES.$@"
# Print build env info to help debug builds on different platforms
dpkg-architecture
cd $(BUILDDIR) && $(MAKE)
cd $(BUILDDIR) && $(MAKE) --output-sync=target
override_dh_auto_test:
@echo "RULES.$@"
......
......@@ -34,7 +34,7 @@ build:
- mv ${CCACHE_WORK_DIR} ${CCACHE_TMP_DIR}
# Run Salsa-CI .build-script equivalent, with extra devscripts so autobake-deb.sh can run 'dch'
- export CCACHE_DIR=${CCACHE_TMP_DIR}
- apt-get update && eatmydata apt-get install --no-install-recommends -y ccache fakeroot build-essential devscripts
- apt-get update && eatmydata apt-get install --no-install-recommends -y ccache fakeroot build-essential devscripts lsb-release
- cd ${WORKING_DIR}/${SOURCE_DIR}
- eatmydata apt-get build-dep --no-install-recommends -y .
- update-ccache-symlinks; ccache -z # Zero out ccache counters
......
......@@ -1790,6 +1790,18 @@ int main(
}
if (ferror(fil_in)) {
#ifdef _AIX
/*
AIX fseeko can go past eof without error.
the error occurs on read, hence output the
same error here as would show up on other
platforms. This shows up in the mtr test
innodb_zip.innochecksum_3-4k,crc32,innodb
*/
if (errno == EFBIG) {
goto unexpected_eof;
}
#endif
fprintf(stderr, "Error reading " ULINTPF " bytes",
physical_page_size);
perror(" ");
......
......@@ -2532,3 +2532,24 @@ progress
#
# End of 10.3 tests
#
#
# Start of 10.5 tests
#
#
# MDEV-26507 Assertion `tmp != ((long long) 0x8000000000000000LL)' failed in TIME_from_longlong_datetime_packed
#
CREATE TABLE t1 (a int);
CREATE ALGORITHM=TEMPTABLE VIEW i AS
SELECT a.created
FROM t1 w JOIN INFORMATION_SCHEMA.routines a
WHERE a.routine_name='not existing'
ORDER BY a.last_altered;
SET SESSION sql_mode='ALLOW_INVALID_DATES';
SELECT * FROM i;
created
SET SESSION sql_mode=DEFAULT;
DROP VIEW i;
DROP TABLE t1;
#
# End of 10.5 tests
#
......@@ -2111,3 +2111,27 @@ select progress from information_schema.processlist limit 1;
--echo #
--echo # End of 10.3 tests
--echo #
--echo #
--echo # Start of 10.5 tests
--echo #
--echo #
--echo # MDEV-26507 Assertion `tmp != ((long long) 0x8000000000000000LL)' failed in TIME_from_longlong_datetime_packed
--echo #
CREATE TABLE t1 (a int);
CREATE ALGORITHM=TEMPTABLE VIEW i AS
SELECT a.created
FROM t1 w JOIN INFORMATION_SCHEMA.routines a
WHERE a.routine_name='not existing'
ORDER BY a.last_altered;
SET SESSION sql_mode='ALLOW_INVALID_DATES';
SELECT * FROM i;
SET SESSION sql_mode=DEFAULT;
DROP VIEW i;
DROP TABLE t1;
--echo #
--echo # End of 10.5 tests
--echo #
This diff is collapsed.
......@@ -295,3 +295,80 @@ BEGIN NOT ATOMIC
END
$$
DELIMITER ;$$
--echo #
--echo # Testing various keywords in various contexts
--echo #
DELIMITER $$;
CREATE PROCEDURE p1(query TEXT, var TEXT)
BEGIN
DECLARE errmsg TEXT DEFAULT '';
DECLARE CONTINUE HANDLER
FOR SQLEXCEPTION
BEGIN
GET DIAGNOSTICS CONDITION 1 errmsg = MESSAGE_TEXT;
SET errmsg= REPLACE(errmsg, 'You have an error in your SQL ', '..');
SET errmsg= REPLACE(errmsg, '; check the manual that corresponds to your MariaDB server version for the right syntax to use', '..');
END;
SET query=REPLACE(query, '$(VAR)', var);
EXECUTE IMMEDIATE query;
SELECT CONCAT(query, '; -- ', LEFT(COALESCE(errmsg,''),40)) AS `--------`;
END;
$$
CREATE PROCEDURE p2(query TEXT)
BEGIN
FOR row IN (SELECT word FROM t1 ORDER BY category, word)
DO
CALL p1(query, row.word);
END FOR;
END;
$$
DELIMITER ;$$
CREATE TABLE t1 (word TEXT, category TEXT);
INSERT INTO t1 VALUES ('non_keyword', '00 Simple identifier');
INSERT INTO t1 VALUES ('lpad', '01 Built-in native function');
INSERT INTO t1 VALUES ('rpad', '01 Built-in native function');
INSERT INTO t1 VALUES ('adddate', '02 function_call_nonkeyword');
INSERT INTO t1 VALUES ('substr', '02 function_call_nonkeyword');
INSERT INTO t1 VALUES ('substring', '02 function_call_nonkeyword');
INSERT INTO t1 VALUES ('trim_oracle', '02 function_call_nonkeyword');
INSERT INTO t1 VALUES ('ascii', '03 function_call_conflict');
INSERT INTO t1 VALUES ('replace', '03 function_call_conflict');
INSERT INTO t1 VALUES ('weight_string', '03 function_call_conflict');
INSERT INTO t1 VALUES ('char', '04 function_call_keyword');
INSERT INTO t1 VALUES ('trim', '04 function_call_keyword');
INSERT INTO t1 VALUES ('year', '04 function_call_keyword');
INSERT INTO t1 VALUES ('create', '05 Reserved keyword');
CALL p2('SELECT @@$(VAR)');
CALL p2('SELECT @@global.$(VAR)');
CALL p2('SELECT @@global.$(VAR)()');
CALL p2('SELECT $(VAR)()');
CALL p2('SELECT test.$(VAR)()');
CALL p2('SELECT $(VAR) FROM t1');
CALL p2('SELECT t1.$(VAR) FROM t1');
CALL p2('DROP TABLE $(VAR)');
CALL p2('DROP TABLE test.$(VAR)');
CALL p2('CREATE FUNCTION $(VAR)() RETURNS OOPS');
CALL p2('CREATE FUNCTION test.$(VAR)() RETURNS OOPS');
CALL p2('DROP FUNCTION $(VAR)');
CALL p2('DROP FUNCTION test.$(VAR)');
DROP TABLE t1;
DROP PROCEDURE p1;
DROP PROCEDURE p2;
source include/not_embedded.inc;
source include/not_aix.inc;
let $have_plugin = `SELECT COUNT(*) FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_STATUS='ACTIVE' AND PLUGIN_NAME = 'THREAD_POOL_GROUPS'`;
if(!$have_plugin)
......
......@@ -28,3 +28,21 @@ CREATE TEMPORARY TABLE t1 LIKE INFORMATION_SCHEMA.INNODB_TRX;
DROP TEMPORARY TABLE t1;
CREATE TEMPORARY TABLE t1 AS SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX LIMIT 0;
DROP TEMPORARY TABLE t1;
#
# Start of 10.5 tests
#
#
# MDEV-26507 Assertion `tmp != ((long long) 0x8000000000000000LL)' failed in TIME_from_longlong_datetime_packed
#
CREATE ALGORITHM=TEMPTABLE VIEW i AS
SELECT a.trx_started
FROM INFORMATION_SCHEMA.innodb_lock_waits w
JOIN INFORMATION_SCHEMA.innodb_trx a
ORDER BY a.trx_wait_started;
SET SESSION sql_mode='ALLOW_INVALID_DATES';
SELECT * FROM i;
SET SESSION sql_mode=DEFAULT;
DROP VIEW i;
#
# End of 10.5 tests
#
......@@ -7,3 +7,28 @@ DROP TEMPORARY TABLE t1;
CREATE TEMPORARY TABLE t1 AS SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX LIMIT 0;
DROP TEMPORARY TABLE t1;
--echo #
--echo # Start of 10.5 tests
--echo #
--echo #
--echo # MDEV-26507 Assertion `tmp != ((long long) 0x8000000000000000LL)' failed in TIME_from_longlong_datetime_packed
--echo #
CREATE ALGORITHM=TEMPTABLE VIEW i AS
SELECT a.trx_started
FROM INFORMATION_SCHEMA.innodb_lock_waits w
JOIN INFORMATION_SCHEMA.innodb_trx a
ORDER BY a.trx_wait_started;
SET SESSION sql_mode='ALLOW_INVALID_DATES';
--disable_result_log
SELECT * FROM i;
--enable_result_log
SET SESSION sql_mode=DEFAULT;
DROP VIEW i;
--echo #
--echo # End of 10.5 tests
--echo #
SET GLOBAL event_scheduler = OFF;
SELECT name, type, processlist_user, processlist_host, processlist_db,
processlist_command, processlist_info,
processlist_command, processlist_info, connection_type,
IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
AS unified_parent_thread_id,
role, instrumented
......@@ -14,6 +14,7 @@ processlist_host NULL
processlist_db mysql
processlist_command NULL
processlist_info NULL
connection_type NULL
unified_parent_thread_id NULL
role NULL
instrumented YES
......@@ -24,6 +25,7 @@ processlist_host NULL
processlist_db NULL
processlist_command NULL
processlist_info NULL
connection_type NULL
unified_parent_thread_id unified parent_thread_id
role NULL
instrumented YES
......@@ -34,13 +36,14 @@ processlist_host localhost
processlist_db test
processlist_command Query
processlist_info SELECT name, type, processlist_user, processlist_host, processlist_db,
processlist_command, processlist_info,
processlist_command, processlist_info, connection_type,
IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
AS unified_parent_thread_id,
role, instrumented
FROM performance_schema.threads
WHERE name LIKE 'thread/sql%'
ORDER BY name
connection_type Socket
unified_parent_thread_id unified parent_thread_id
role NULL
instrumented YES
......@@ -51,6 +54,7 @@ processlist_host NULL
processlist_db NULL
processlist_command NULL
processlist_info NULL
connection_type NULL
unified_parent_thread_id unified parent_thread_id
role NULL
instrumented YES
......
......@@ -32,7 +32,7 @@ SET GLOBAL event_scheduler = OFF;
# Therefore we have to disable this protocol for the next statement.
--disable_ps_protocol
SELECT name, type, processlist_user, processlist_host, processlist_db,
processlist_command, processlist_info,
processlist_command, processlist_info, connection_type,
IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
AS unified_parent_thread_id,
role, instrumented
......
......@@ -1182,56 +1182,61 @@ int ha_spider::external_lock(
int error_num = 0;
SPIDER_TRX *trx;
backup_error_status();
DBUG_ENTER("ha_spider::external_lock");
DBUG_PRINT("info",("spider this=%p", this));
DBUG_PRINT("info",("spider lock_type=%x", lock_type));
#if MYSQL_VERSION_ID < 50500
DBUG_PRINT("info",("spider thd->options=%x", (int) thd->options));
#endif
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (
wide_handler->stage == SPD_HND_STAGE_EXTERNAL_LOCK &&
wide_handler->stage_executor != this)
DBUG_PRINT("info", ("spider sql_command=%d", thd_sql_command(thd)));
if (wide_handler->stage == SPD_HND_STAGE_EXTERNAL_LOCK)
{
/* Only the stage executor deals with table locks. */
if (wide_handler->stage_executor != this)
{
DBUG_RETURN(0);
}
wide_handler->stage = SPD_HND_STAGE_EXTERNAL_LOCK;
wide_handler->stage_executor = this;
#endif
#ifdef HANDLER_HAS_NEED_INFO_FOR_AUTO_INC
info_auto_called = FALSE;
#endif
}
else
{
/* Update the stage executor when the stage changes */
wide_handler->stage= SPD_HND_STAGE_EXTERNAL_LOCK;
wide_handler->stage_executor= this;
}
info_auto_called = FALSE;
wide_handler->external_lock_type= lock_type;
wide_handler->sql_command = thd_sql_command(thd);
/* We treat BEGIN as if UNLOCK TABLE. */
if (wide_handler->sql_command == SQLCOM_BEGIN)
{
wide_handler->sql_command = SQLCOM_UNLOCK_TABLES;
}
if (lock_type == F_UNLCK &&
wide_handler->sql_command != SQLCOM_UNLOCK_TABLES)
{
DBUG_RETURN(0);
}
trx = spider_get_trx(thd, TRUE, &error_num);
if (error_num)
{
DBUG_RETURN(error_num);
}
wide_handler->trx = trx;
DBUG_PRINT("info",("spider sql_command=%d", wide_handler->sql_command));
#ifdef HA_CAN_BULK_ACCESS
wide_handler->external_lock_cnt++;
#endif
if (
lock_type == F_UNLCK &&
wide_handler->sql_command != SQLCOM_UNLOCK_TABLES
)
DBUG_RETURN(0);
/* Question: Why the following if block is necessary? Why here? */
if (store_error_num)
{
DBUG_RETURN(store_error_num);
wide_handler->external_lock_type = lock_type;
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
if ((conn_kinds & SPIDER_CONN_KIND_MYSQL))
}
DBUG_ASSERT(wide_handler->sql_command != SQLCOM_RENAME_TABLE &&
wide_handler->sql_command != SQLCOM_DROP_DB);
if (wide_handler->sql_command == SQLCOM_DROP_TABLE ||
wide_handler->sql_command == SQLCOM_ALTER_TABLE)
{
#endif
if (
/* SQLCOM_RENAME_TABLE and SQLCOM_DROP_DB don't come here */
wide_handler->sql_command == SQLCOM_DROP_TABLE ||
wide_handler->sql_command == SQLCOM_ALTER_TABLE
) {
if (trx->locked_connections)
{
my_message(ER_SPIDER_ALTER_BEFORE_UNLOCK_NUM,
......@@ -1240,17 +1245,20 @@ int ha_spider::external_lock(
}
DBUG_RETURN(0);
}
if (unlikely((error_num = spider_internal_start_trx(this))))
if (lock_type != F_UNLCK)
{
if (unlikely((error_num= spider_internal_start_trx(this))))
{
DBUG_RETURN(error_num);
}
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
} else {
trans_register_ha(trx->thd, FALSE, spider_hton_ptr);
if (thd_test_options(trx->thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
trans_register_ha(trx->thd, TRUE, spider_hton_ptr);
if (wide_handler->sql_command != SQLCOM_SELECT &&
wide_handler->sql_command != SQLCOM_HA_READ)
{
trx->updated_in_this_trx= TRUE;
DBUG_PRINT("info", ("spider trx->updated_in_this_trx=TRUE"));
}
}
#endif
if (wide_handler->lock_table_type > 0 ||
wide_handler->sql_command == SQLCOM_UNLOCK_TABLES)
......@@ -1263,11 +1271,9 @@ int ha_spider::external_lock(
}
/* lock/unlock tables */
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (partition_handler && partition_handler->handlers)
{
uint roop_count;
for (roop_count = 0; roop_count < partition_handler->no_parts;
for (uint roop_count= 0; roop_count < partition_handler->no_parts;
++roop_count)
{
if (unlikely((error_num =
......@@ -1276,54 +1282,13 @@ int ha_spider::external_lock(
DBUG_RETURN(error_num);
}
}
} else {
#endif
if (unlikely((error_num = lock_tables())))
}
else if (unlikely((error_num= lock_tables())))
{
DBUG_RETURN(error_num);
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
}
#endif
}
DBUG_PRINT("info",("spider trx_start=%s",
trx->trx_start ? "TRUE" : "FALSE"));
/* need to check after spider_internal_start_trx() */
if (trx->trx_start)
{
switch (wide_handler->sql_command)
{
case SQLCOM_SELECT:
case SQLCOM_HA_READ:
#ifdef HS_HAS_SQLCOM
case SQLCOM_HS_READ:
#endif
/* nothing to do */
break;
case SQLCOM_UPDATE:
case SQLCOM_UPDATE_MULTI:
#ifdef HS_HAS_SQLCOM
case SQLCOM_HS_UPDATE:
#endif
case SQLCOM_CREATE_TABLE:
case SQLCOM_INSERT:
case SQLCOM_INSERT_SELECT:
case SQLCOM_DELETE:
case SQLCOM_LOAD:
case SQLCOM_REPLACE:
case SQLCOM_REPLACE_SELECT:
case SQLCOM_DELETE_MULTI:
#ifdef HS_HAS_SQLCOM
case SQLCOM_HS_INSERT:
case SQLCOM_HS_DELETE:
#endif
default:
trx->updated_in_this_trx = TRUE;
DBUG_PRINT("info",("spider trx->updated_in_this_trx=TRUE"));
break;
}
}
DBUG_RETURN(0);
}
......
#
# MDEV-27239 Spider: Assertion `thd->transaction->stmt.ha_list == __null || trans == &thd->transaction->stmt' failed in ha_commit_trans on BEGIN WORK after FTWRL
#
for master_1
for child2
for child3
CREATE DATABASE auto_test_local;
USE auto_test_local;
CREATE TABLE tbl_a (a INT) ENGINE=SPIDER;
FLUSH TABLE tbl_a WITH READ LOCK;
Warnings:
Error 1429 Unable to connect to foreign data source: localhost
Error 1429 Unable to connect to foreign data source: localhost
Error 1429 Unable to connect to foreign data source: localhost
Error 1429 Unable to connect to foreign data source: localhost
BEGIN;
DROP DATABASE auto_test_local;
for master_1
for child2
for child3
!include include/default_mysqld.cnf
!include ../my_1_1.cnf
--echo #
--echo # MDEV-27239 Spider: Assertion `thd->transaction->stmt.ha_list == __null || trans == &thd->transaction->stmt' failed in ha_commit_trans on BEGIN WORK after FTWRL
--echo #
--disable_query_log
--disable_result_log
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
CREATE DATABASE auto_test_local;
USE auto_test_local;
CREATE TABLE tbl_a (a INT) ENGINE=SPIDER;
FLUSH TABLE tbl_a WITH READ LOCK;
BEGIN;
DROP DATABASE auto_test_local;
--disable_query_log
--disable_result_log
--source ../../t/test_deinit.inc
--enable_result_log
--enable_query_log
......@@ -613,7 +613,7 @@ enum enum_vio_type vio_type(Vio* vio)
static const LEX_CSTRING vio_type_names[] =
{
{ STRING_WITH_LEN("Error") }, // cannot happen
{ STRING_WITH_LEN("") }, // internal threads
{ STRING_WITH_LEN("TCP/IP") },
{ STRING_WITH_LEN("Socket") },
{ STRING_WITH_LEN("Named Pipe") },
......
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