Skip to content

MCOL-5998 add test #3577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: stable-23.10
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 128 additions & 0 deletions mysql-test/columnstore/bugfixes/mcol-5998.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
DROP DATABASE IF EXISTS `mcol_5998`;
CREATE DATABASE `mcol_5998`;
USE `mcol_5998`;
CREATE USER IF NOT EXISTS'cejuser'@'localhost' IDENTIFIED BY 'Vagrant1|0000001';
GRANT ALL PRIVILEGES ON *.* TO 'cejuser'@'localhost';
FLUSH PRIVILEGES;
show variables like 'columnstore_innodb_queries_use_mcs';
Variable_name Value
columnstore_innodb_queries_use_mcs ON
CREATE TABLE test_cs (a INT, b VARCHAR(100)) ENGINE=Columnstore;
INSERT INTO test_cs VALUES
(1, 'Test1'),
(2, 'Test2'),
(3, 'Test3'),
(4, 'Test4');
INSERT INTO test_cs VALUES
(5, NULL);
CREATE TABLE test_innodb (a INT, b VARCHAR(100));
INSERT INTO test_innodb VALUES
(1, 'innodb1'),
(2, 'innodb2'),
(3, 'innodb3'),
(5, 'innodb5');
SELECT * FROM test_cs;
a b
1 Test1
2 Test2
3 Test3
4 Test4
5 NULL
SELECT * FROM test_innodb;
a b
1 innodb1
2 innodb2
3 innodb3
5 innodb5
SELECT
cs.a AS cs_a,
cs.b AS cs_b,
idb.b AS idb_b
FROM
test_cs AS cs
INNER JOIN
test_innodb AS idb
ON cs.a = idb.a
ORDER BY cs.a;
cs_a cs_b idb_b
1 Test1 innodb1
2 Test2 innodb2
3 Test3 innodb3
5 NULL innodb5
SELECT
cs.a AS cs_a,
cs.b AS cs_b,
idb.b AS idb_b
FROM
test_cs AS cs
LEFT JOIN
test_innodb AS idb
ON cs.a = idb.a
ORDER BY cs.a;
cs_a cs_b idb_b
1 Test1 innodb1
2 Test2 innodb2
3 Test3 innodb3
4 Test4 NULL
5 NULL innodb5
SELECT
cs.a AS cs_a,
cs.b AS cs_b,
idb.a AS idb_a,
idb.b AS idb_b
FROM
test_cs AS cs
RIGHT JOIN
test_innodb AS idb
ON cs.a = idb.a
ORDER BY idb.a;
cs_a cs_b idb_a idb_b
1 Test1 1 innodb1
2 Test2 2 innodb2
3 Test3 3 innodb3
5 NULL 5 innodb5
SELECT
cs.b AS cs_b,
COUNT(idb.a) AS matching_innodb_count
FROM
test_cs AS cs
LEFT JOIN
test_innodb AS idb
ON cs.a = idb.a
GROUP BY
cs.b
ORDER BY
cs.b;
cs_b matching_innodb_count
NULL 1
Test1 1
Test2 1
Test3 1
Test4 0
SELECT
idb.*
FROM
test_innodb AS idb
WHERE
idb.a IN (SELECT cs.a FROM test_cs AS cs WHERE cs.a IS NOT NULL)
ORDER BY idb.a;
a b
1 innodb1
2 innodb2
3 innodb3
5 innodb5
UPDATE
test_innodb AS idb
INNER JOIN
test_cs AS cs
ON idb.a = cs.a
SET
idb.b = CONCAT('X_', idb.b);
SELECT * FROM test_innodb ORDER BY a;
a b
1 X_innodb1
2 X_innodb2
3 X_innodb3
5 X_innodb5
DROP USER 'cejuser'@'localhost';
DROP DATABASE `mcol_5998`;
133 changes: 133 additions & 0 deletions mysql-test/columnstore/bugfixes/mcol-5998.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
-- source include/have_innodb.inc
-- source ../include/have_columnstore.inc
-- disable_warnings
DROP DATABASE IF EXISTS `mcol_5998`;
-- enable_warnings
CREATE DATABASE `mcol_5998`;
USE `mcol_5998`;

#
# Enable cross engine join
# Configure user and password in Columnstore.xml file
#

if (!$MASTER_MYPORT)
{
# Running with --extern
let $MASTER_MYPORT=`SELECT @@port`;
}
if (!$MCS_MCSSETCONFIG)
{
let $MCS_MCSSETCONFIG=`mcsSetConfig`;
}


--exec $MCS_MCSSETCONFIG CrossEngineSupport User 'cejuser'
--exec $MCS_MCSSETCONFIG CrossEngineSupport Password 'Vagrant1|0000001'
--exec $MCS_MCSSETCONFIG CrossEngineSupport Port $MASTER_MYPORT
#
# Create corresponding in the server
#
--disable_warnings
CREATE USER IF NOT EXISTS'cejuser'@'localhost' IDENTIFIED BY 'Vagrant1|0000001';
--enable_warnings
GRANT ALL PRIVILEGES ON *.* TO 'cejuser'@'localhost';
FLUSH PRIVILEGES;

--echo #log_error
select @@log_error;

--exec printf "\ncolumnstore_innodb_queries_use_mcs = ON\n" >> /etc/my.cnf.d/columnstore.cnf
# Restart server to apply configuration change
-- source include/restart_mysqld.inc

show variables like 'columnstore_innodb_queries_use_mcs';

CREATE TABLE test_cs (a INT, b VARCHAR(100)) ENGINE=Columnstore;
INSERT INTO test_cs VALUES
(1, 'Test1'),
(2, 'Test2'),
(3, 'Test3'),
(4, 'Test4');
INSERT INTO test_cs VALUES
(5, NULL);

CREATE TABLE test_innodb (a INT, b VARCHAR(100));
INSERT INTO test_innodb VALUES
(1, 'innodb1'),
(2, 'innodb2'),
(3, 'innodb3'),
(5, 'innodb5');

SELECT * FROM test_cs;
SELECT * FROM test_innodb;

SELECT
cs.a AS cs_a,
cs.b AS cs_b,
idb.b AS idb_b
FROM
test_cs AS cs
INNER JOIN
test_innodb AS idb
ON cs.a = idb.a
ORDER BY cs.a;

SELECT
cs.a AS cs_a,
cs.b AS cs_b,
idb.b AS idb_b
FROM
test_cs AS cs
LEFT JOIN
test_innodb AS idb
ON cs.a = idb.a
ORDER BY cs.a;

SELECT
cs.a AS cs_a,
cs.b AS cs_b,
idb.a AS idb_a,
idb.b AS idb_b
FROM
test_cs AS cs
RIGHT JOIN
test_innodb AS idb
ON cs.a = idb.a
ORDER BY idb.a;

SELECT
cs.b AS cs_b,
COUNT(idb.a) AS matching_innodb_count
FROM
test_cs AS cs
LEFT JOIN
test_innodb AS idb
ON cs.a = idb.a
GROUP BY
cs.b
ORDER BY
cs.b;

SELECT
idb.*
FROM
test_innodb AS idb
WHERE
idb.a IN (SELECT cs.a FROM test_cs AS cs WHERE cs.a IS NOT NULL)
ORDER BY idb.a;

UPDATE
test_innodb AS idb
INNER JOIN
test_cs AS cs
ON idb.a = cs.a
SET
idb.b = CONCAT('X_', idb.b);

SELECT * FROM test_innodb ORDER BY a;

# Cleanup
DROP USER 'cejuser'@'localhost';
DROP DATABASE `mcol_5998`;