You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.5 KiB

  1. #--source include/have_tokudb.inc
  2. SET DEFAULT_STORAGE_ENGINE='tokudb';
  3. #
  4. # Bug #22169: Crash with count(distinct)
  5. #
  6. --echo *** Bug #22169 ***
  7. --disable_warnings
  8. DROP TABLE IF EXISTS t1;
  9. --enable_warnings
  10. CREATE TABLE t1 (a int, b bigint, c varchar(30), d date, e int, primary key (a));
  11. INSERT into t1 values (1,54,"zardosht", '1986-08-30', 3287);
  12. INSERT into t1 values (2,8709,"Alaadin", '1789-01-31', 8327);
  13. INSERT into t1 values (3,234,"Gilbert", '1325-05-21', 871233);
  14. INSERT into t1 values (4,563,"Lois", '1981-11-06', 654);
  15. INSERT into t1 values (5,587,"Lexington", '1844-03-01', 75);
  16. INSERT into t1 values (6,934764,"Goliath", '1161-11-01', 453);
  17. INSERT into t1 values (7,109234,"Peter", '2005-11-01', 5);
  18. INSERT into t1 values (8,9438,"Bart", '1472-11-01', 234);
  19. INSERT into t1 values (9,111111111,"Superman", '1776-07-04', 65);
  20. INSERT into t1 values (10,50000004,"Batman", '1981-11-01', 87423);
  21. SELECT * from t1;
  22. alter table t1 drop primary key;
  23. SELECT * from t1;
  24. alter table t1 add primary key (c(3));
  25. SELECT * from t1;
  26. alter table t1 drop primary key;
  27. SELECT * from t1;
  28. alter table t1 add primary key (a,c(3));
  29. SELECT * from t1;
  30. alter table t1 drop primary key;
  31. SELECT * from t1;
  32. alter table t1 add primary key (c(3),a);
  33. SELECT * from t1;
  34. alter table t1 drop primary key;
  35. SELECT * from t1;
  36. alter table t1 add primary key (c(3),e);
  37. SELECT * from t1;
  38. alter table t1 drop primary key;
  39. SELECT * from t1;
  40. alter table t1 add primary key (e,c(3));
  41. SELECT * from t1;
  42. DROP TABLE t1;