You've already forked mariadb-columnstore-engine
							
							
				mirror of
				https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
				synced 2025-11-03 17:13:17 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			59 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			59 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
# -------------------------------------------------------------- #
 | 
						|
# Version buffer test
 | 
						|
#
 | 
						|
# Author: Daniel Lee, daniel.lee@mariadb.com
 | 
						|
# -------------------------------------------------------------- #
 | 
						|
#
 | 
						|
--source ../include/have_columnstore.inc
 | 
						|
--source ../include/detect_maxscale.inc
 | 
						|
#
 | 
						|
--disable_warnings
 | 
						|
DROP DATABASE IF EXISTS mcs7000_db;
 | 
						|
--enable_warnings
 | 
						|
#
 | 
						|
CREATE DATABASE mcs7000_db;
 | 
						|
USE mcs7000_db;
 | 
						|
# -------------------------------------------------------------- #
 | 
						|
# Create test tables
 | 
						|
# -------------------------------------------------------------- #
 | 
						|
create table lineitem (
 | 
						|
l_orderkey int,
 | 
						|
l_partkey int,
 | 
						|
l_suppkey int,
 | 
						|
l_linenumber bigint,
 | 
						|
l_quantity decimal(12,2),
 | 
						|
l_extendedprice decimal(12,2),
 | 
						|
l_discount decimal(12,2),
 | 
						|
l_tax decimal(12,2),
 | 
						|
l_returnflag char (1),
 | 
						|
l_linestatus char (1),
 | 
						|
l_shipdate date,
 | 
						|
l_commitdate date,
 | 
						|
l_receiptdate date,
 | 
						|
l_shipinstruct char (25),
 | 
						|
l_shipmode char (10),
 | 
						|
l_comment varchar (44)
 | 
						|
) engine=columnstore DEFAULT CHARSET=utf8mb3;
 | 
						|
# -------------------------------------------------------------- #
 | 
						|
# LDI 10g dataset for the lineitem table
 | 
						|
# -------------------------------------------------------------- #
 | 
						|
LOAD DATA INFILE '/data/qa/source/dbt3/10g/lineitem.tbl' INTO TABLE lineitem FIELDS TERMINATED BY '|';
 | 
						|
LOAD DATA INFILE '/data/qa/source/dbt3/10g/lineitem.tbl' INTO TABLE lineitem FIELDS TERMINATED BY '|';
 | 
						|
LOAD DATA INFILE '/data/qa/source/dbt3/10g/lineitem.tbl' INTO TABLE lineitem FIELDS TERMINATED BY '|';
 | 
						|
SELECT COUNT(*) FROM lineitem;
 | 
						|
#
 | 
						|
# Version buffer positive test - successful update expected
 | 
						|
SET autocommit=off;
 | 
						|
UPDATE lineitem SET l_orderkey=-1, l_linenumber=-1;
 | 
						|
SELECT COUNT(*) FROM lineitem where l_orderkey=-1 and l_linenumber=-1;
 | 
						|
rollback;
 | 
						|
SELECT COUNT(*) FROM lineitem where l_orderkey=-1 and l_linenumber=-1;
 | 
						|
# Version buffer negative test - overflow error expected
 | 
						|
--error 1815
 | 
						|
--error ER_INTERNAL_ERROR
 | 
						|
update lineitem set l_orderkey=-2, l_linenumber=-2, l_comment='hello', l_shipinstruct=l_shipmode;
 | 
						|
SELECT COUNT(*) FROM lineitem where l_orderkey=-2 and l_linenumber=-2 and l_comment='hello' and l_shipinstruct=l_shipmode;
 | 
						|
#
 | 
						|
DROP DATABASE mcs7000_db;
 | 
						|
#
 |