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.

122 lines
4.0 KiB

  1. -- source include/have_ndb.inc
  2. -- source include/not_embedded.inc
  3. --disable_warnings
  4. drop table if exists t1;
  5. --enable_warnings
  6. create table t1 (
  7. pk1 int not null primary key,
  8. b bit(64)
  9. ) engine=ndbcluster;
  10. show create table t1;
  11. insert into t1 values
  12. (0,b'1111111111111111111111111111111111111111111111111111111111111111'),
  13. (1,b'1000000000000000000000000000000000000000000000000000000000000000'),
  14. (2,b'0000000000000000000000000000000000000000000000000000000000000001'),
  15. (3,b'1010101010101010101010101010101010101010101010101010101010101010'),
  16. (4,b'0101010101010101010101010101010101010101010101010101010101010101');
  17. select hex(b) from t1 order by pk1;
  18. drop table t1;
  19. create table t1 (
  20. pk1 int not null primary key,
  21. b bit(9)
  22. ) engine=ndbcluster;
  23. insert into t1 values
  24. (0,b'000000000'),
  25. (1,b'000000001'),
  26. (2,b'000000010'),
  27. (3,b'000000011'),
  28. (4,b'000000100');
  29. select hex(b) from t1 order by pk1;
  30. update t1 set b = b + b'101010101';
  31. select hex(b) from t1 order by pk1;
  32. drop table t1;
  33. create table t1 (a bit(7), b bit(9)) engine = ndbcluster;
  34. insert into t1 values
  35. (94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),
  36. (75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),
  37. (111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),
  38. (116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),
  39. (30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),
  40. (44, 307), (68, 454), (57, 135);
  41. select a+0 from t1 order by a;
  42. select b+0 from t1 order by b;
  43. drop table t1;
  44. create table t1 (
  45. dummyKey INTEGER NOT NULL,
  46. a001 TINYINT,
  47. a010 TINYINT,
  48. a012 TINYINT,
  49. a015 TINYINT,
  50. a016 TINYINT,
  51. a017 TINYINT,
  52. a019 TINYINT,
  53. a029 TINYINT,
  54. a030 TINYINT,
  55. a031 TINYINT,
  56. a032 TINYINT,
  57. a042 TINYINT,
  58. a043 TINYINT,
  59. a044 TINYINT,
  60. a3001 TINYINT,
  61. a3002 TINYINT,
  62. a3003 TINYINT,
  63. a3004 TINYINT,
  64. a3005 TINYINT,
  65. a3021 TINYINT,
  66. a3022 TINYINT,
  67. a BIT(6),
  68. b BIT(6),
  69. c BIT(6),
  70. d TINYINT,
  71. e TINYINT,
  72. f TINYINT,
  73. g TINYINT,
  74. h TINYINT,
  75. i TINYINT,
  76. j TINYINT,
  77. k TINYINT,
  78. l TINYINT,
  79. m TINYINT,
  80. n TINYINT,
  81. o TINYINT,
  82. a034 TINYINT,
  83. PRIMARY KEY USING HASH (dummyKey) ) engine=ndb;
  84. INSERT INTO `t1` VALUES
  85. (1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000001',b'111111',b'111110',4,5,5,5,5,5,5,5,5,5,3,2,1),
  86. (2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000010',b'000000',b'111101',4,5,5,5,5,5,5,5,5,5,3,2,1),
  87. (3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000100',b'001111',b'111011',4,5,5,5,5,5,5,5,5,5,3,2,1),
  88. (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'001000',b'110000',b'110111',4,5,5,5,5,5,5,5,5,5,3,2,1),
  89. (5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'010000',b'100001',b'101111',4,5,5,5,5,5,5,5,5,5,3,2,1),
  90. (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'100000',b'010010',b'011111',4,5,5,5,5,5,5,5,5,5,3,2,1),
  91. (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'001100',b'111111',4,5,5,5,5,5,5,5,5,5,3,2,1),
  92. (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1);
  93. --exec $MYSQL_DUMP --hex-blob --compact --order-by-primary --skip-extended-insert --no-create-info test t1
  94. drop table t1;
  95. --error 1005
  96. create table t1 (
  97. pk1 bit(9) not null primary key,
  98. b int
  99. ) engine=ndbcluster;
  100. --error 1005
  101. create table t1 (
  102. pk1 int not null primary key,
  103. b bit(9),
  104. key(b)
  105. ) engine=ndbcluster;
  106. # bug#16125
  107. create table t1 (
  108. pk1 int primary key,
  109. b bit(32) not null
  110. ) engine=ndbcluster;
  111. insert into t1 values (1,1);
  112. drop table t1;