1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-26 11:48:52 +03:00
2022-12-09 02:24:40 +00:00

29 lines
845 B
Plaintext

USE tpch1;
drop table if exists bug5289a;
drop table if exists bug5289b;
drop view if exists bug5289b_v;
create table bug5289a(
a decimal(10,0),
b varchar(30))
engine=columnstore;
create table bug5289b(
a char(4),
b varchar(30))
engine=columnstore;
insert into bug5289a values (1, 1), (2, 2), (3, 3), (4, 4);
insert into bug5289b values ('1', '1'), ('3', '3'), ('5', '5');
create or replace view bug5289_v as
select cast(a as decimal(10,0)) as a, b from bug5289b;
select 'q1', count(*) from bug5289a a,bug5289_v b where a.a = b.a;
q1 count(*)
q1 2
select 'q2', count(*) from bug5289a a left join bug5289_v b on (a.a = b.a);
q2 count(*)
q2 4
select 'q3', count(*) from bug5289a a, bug5289b b where a.a = cast(b.a as decimal(10,0));
q3 count(*)
q3 2
drop table if exists bug5289a;
drop table if exists bug5289b;
drop view if exists bug5289b_v;