1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fixed ALTER TABLE on MERGE tables

Fixed bug in DISTINCT


Docs/manual.texi:
  Updated Changelog
  Cleaned up adding character sets
merge/open.c:
  skip comments
myisam/mi_check.c:
  Fixed bug when sorting index on Windows
myisammrg/myrg_info.c:
  Use only portable printf arguments
myisammrg/myrg_rrnd.c:
  Use only portable printf arguments
mysql-test/r/distinct.result:
  Added test case for bug in distinct
mysql-test/r/merge.result:
  Added test for ALTER TABLE
mysql-test/t/distinct.test:
  Added test case for bug in distinct
mysql-test/t/merge.test:
  Added test for ALTER TABLE
sql-bench/crash-me.sh:
  Fixed portability issues
sql/ha_myisammrg.cc:
  Fixed for ALTER TABLE on MERGE tables
sql/item_sum.cc:
  Fixed bug in DISTINCT
sql/sql_db.cc:
  Added test of namelen in check_db_name
sql/sql_select.cc:
  Fixed bug in DISTINCT
sql/sql_select.h:
  Fixed bug in DISTINCT
sql/sql_table.cc:
  Fixed ALTER TABLE on MERGE tables
sql/table.cc:
  Added test of namelen in check_db_name
sql/table.h:
  Fixed ALTER TABLE on MERGE tables
This commit is contained in:
unknown
2001-01-28 21:35:50 +02:00
parent 298ba0d39d
commit 184e24b225
18 changed files with 321 additions and 110 deletions

View File

@ -153,3 +153,17 @@ j_lj_t3 index id id 4 NULL 2 where used; Using index; Distinct
t3_lj index id id 8 NULL 1 where used; Using index; Distinct
id
2
a sec_to_time(sum(time_to_sec(t)))
1 00:06:15
1 00:36:30
1 00:36:30
a sec_to_time(sum(time_to_sec(t)))
1 00:06:15
1 00:36:30
a sec_to_time(sum(time_to_sec(t)))
1 00:06:15
1 00:36:30
1 00:36:30
a sec_to_time(sum(time_to_sec(t)))
1 00:06:15
1 00:36:30

View File

@ -106,4 +106,10 @@ incr othr
2 24
4 33
3 53
count(*)
10
count(*)
20
count(*)
20
a

View File

@ -182,3 +182,19 @@ WHERE
((t1.id=j_lj_t2.id AND t2_lj.id IS NULL) OR (t1.id=t2.id AND t2.idx=2))
AND ((t1.id=j_lj_t3.id AND t3_lj.id IS NULL) OR (t1.id=t3.id AND t3.idx=2));
drop table t1,t2,t3;
#
# Test using DISTINCT on a function that contains a group function
# This also test the case when one doesn't use all fields in GROUP BY.
#
drop table if exists t1;
create table t1 (a int not null, b int not null, t time);
insert into t1 values (1,1,"00:06:15"),(1,2,"00:06:15"),(1,2,"00:30:15"),(1,3,"00:06:15"),(1,3,"00:30:15");
select a,sec_to_time(sum(time_to_sec(t))) from t1 group by a,b;
select distinct a,sec_to_time(sum(time_to_sec(t))) from t1 group by a,b;
create table t2 (a int not null primary key, b int);
insert into t2 values (1,1),(2,2),(3,3);
select t1.a,sec_to_time(sum(time_to_sec(t))) from t1 left join t2 on (t1.b=t2.a) group by t1.a,t2.b;
select distinct t1.a,sec_to_time(sum(time_to_sec(t))) from t1 left join t2 on (t1.b=t2.a) group by t1.a,t2.b;
drop table t1,t2;

View File

@ -35,7 +35,8 @@ select a from t3 order by a desc limit 300,10;
# The following should give errors
create table t4 (a int not null, b char(10), key(a)) type=MERGE UNION=(t1,t2);
drop table if exists t1,t2,t3,t4;
# Because of windows, it's important that we drop the merge tables first!
drop table if exists t4,t3,t1,t2;
create table t1 (c char(10)) type=myisam;
create table t2 (c char(10)) type=myisam;
@ -70,6 +71,12 @@ INSERT INTO t1 VALUES (11,20),(13,43),(15,11),(17,22),(19,37);
INSERT INTO t2 VALUES (12,25),(14,31),(16,42),(18,27),(10,30);
SELECT * from t3 where incr in (1,2,3,4) order by othr;
alter table t3 UNION=(t1);
select count(*) from t3;
alter table t3 UNION=(t1,t2);
select count(*) from t3;
alter table t3 TYPE=MYISAM;
select count(*) from t3;
drop table t3,t2,t1;
#