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 
			
		
		
		
	
		
			
				
	
	
		
			58 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			58 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
# -------------------------------------------------------------- #
 | 
						|
# Test case migrated from regression test suite: bug4543.sql
 | 
						|
#
 | 
						|
# Author: Daniel Lee, daniel.lee@mariadb.com
 | 
						|
# -------------------------------------------------------------- #
 | 
						|
#
 | 
						|
--source ../include/have_columnstore.inc
 | 
						|
#
 | 
						|
USE tpch1;
 | 
						|
#
 | 
						|
#
 | 
						|
# Bug 4543.  EM min/max was getting set for extent that wasn't scanned.  The extent was not scanned because another column's min/max
 | 
						|
#	     value didn't qualify.
 | 
						|
#
 | 
						|
--disable_warnings
 | 
						|
drop table if exists bug4543;
 | 
						|
--enable_warnings
 | 
						|
create table bug4543 (
 | 
						|
dart_ad_id int, 
 | 
						|
hsa_order_id int, 
 | 
						|
date_stamp int,
 | 
						|
adjusted_imp int
 | 
						|
) engine=columnstore;
 | 
						|
 | 
						|
#
 | 
						|
# Insert vals 1..10,000 from supplier.
 | 
						|
#
 | 
						|
insert into bug4543 (select s_suppkey, s_suppkey, s_suppkey, s_suppkey from supplier);
 | 
						|
 | 
						|
#
 | 
						|
# Set the min and max for the last three cols in the table.
 | 
						|
#
 | 
						|
select count(hsa_order_id) from bug4543;
 | 
						|
select count(date_stamp) from bug4543;
 | 
						|
select count(adjusted_imp) from bug4543;
 | 
						|
 | 
						|
#
 | 
						|
# Run this select.  The dart_ad_id column will be the scan column as it's the first one in the table.
 | 
						|
# The date_stamp filter will cause the extent to be skipped.
 | 
						|
#
 | 
						|
select date_stamp, sum(adjusted_imp)
 | 
						|
          from bug4543
 | 
						|
          where date_stamp>=20000
 | 
						|
          and hsa_order_id>=3 and dart_ad_id=3
 | 
						|
          group by date_stamp
 | 
						|
          order by date_stamp;
 | 
						|
 | 
						|
#
 | 
						|
# Validate that we see 10,000 rows with dart_ad_id >= 1.  Before the fix, this was returning 0 rows as the min was max and the max was min
 | 
						|
# and the extent status was set to valid.
 | 
						|
#
 | 
						|
select count(*) from bug4543 where dart_ad_id >= 1;
 | 
						|
#
 | 
						|
--disable_warnings
 | 
						|
drop table if exists bug4543;
 | 
						|
--enable_warnings
 | 
						|
#
 |