1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-15 22:22:17 +03:00
Files
mariadb-columnstore-engine/mysql/queries/working_dml/misc/bug3326b.sql
2016-01-06 14:08:59 -06:00

17 lines
649 B
SQL

set autocommit=0;
# Set c_nationkey
select count(*) from customer where c_custkey in (select o_custkey from orders);
update customer set c_nationkey=-1 where c_custkey in (select o_custkey from orders);
select count(*) from customer where c_nationkey=-1;
rollback;
select count(*) from customer where c_nationkey=-1;
# Set c_nationkey to the order count for each customer.
update customer set c_nationkey = null;
update customer set c_nationkey = (select count(*) from orders where o_custkey=c_custkey);
select c_nationkey, count(*) from customer group by 1 order by 1;
rollback;
select c_nationkey, count(*) from customer group by 1 order by 1;