~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/create.result

  • Committer: Stewart Smith
  • Author(s): Marko Mäkelä, Stewart Smith
  • Date: 2010-11-17 05:52:09 UTC
  • mto: (2021.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1971.
  • Revision ID: stewart@flamingspork.com-20101117055209-69m035q6h7e1txrc
Merge Revision revid:marko.makela@oracle.com-20100629113248-fvl48lnzr44z94gg from MySQL InnoDB

Original revid:marko.makela@oracle.com-20100629113248-fvl48lnzr44z94gg

Original Authors: Marko Mkel <marko.makela@oracle.com>
Original commit message:
Bug#52199 utf32: mbminlen=4, mbmaxlen=4, type->mbminlen=0, type->mbmaxlen=4

Merge and adjust a forgotten change to fix this bug.
rb://393 approved by Jimmy Yang
  ------------------------------------------------------------------------
  r3794 | marko | 2009-01-07 14:14:53 +0000 (Wed, 07 Jan 2009) | 18 lines

  branches/6.0: Allow the minimum length of a multi-byte character to be
  up to 4 bytes. (Bug #35391)

  dtype_t, dict_col_t: Replace mbminlen:2, mbmaxlen:3 with mbminmaxlen:5.
  In this way, the 5 bits can hold two values of 0..4, and the storage size
  of the fields will not cross the 64-bit boundary.  Encode the values as
  DATA_MBMAX * mbmaxlen + mbminlen.  Define the auxiliary macros
  DB_MBMINLEN(mbminmaxlen), DB_MBMAXLEN(mbminmaxlen), and
  DB_MINMAXLEN(mbminlen, mbmaxlen).

  Try to trim and pad UTF-16 and UTF-32 with spaces as appropriate.

  Alexander Barkov suggested the use of cs->cset->fill(cs, buff, len, 0x20).
  ha_innobase::store_key_val_for_row() now does that, but the added function
  row_mysql_pad_col() does not, because it doesn't have the MySQL TABLE object.

  rb://49 approved by Heikki Tuuri
  ------------------------------------------------------------------------

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
create temporary table t1 (a int not null auto_increment,primary key (a)) engine=MEMORY;
20
20
drop table t1;
21
21
create temporary table t2 engine=MEMORY select * from t1;
22
 
ERROR 42S02: Unknown table 'test.t1'
 
22
ERROR 42S02: Table 'test.t1' doesn't exist
23
23
create table t2 select auto+1 from t1;
24
 
ERROR 42S02: Unknown table 'test.t1'
 
24
ERROR 42S02: Table 'test.t1' doesn't exist
25
25
drop table if exists t1,t2;
26
26
Warnings:
27
27
Note    1051    Unknown table 't1'
167
167
CREATE TABLE t2 (primary key(a)) SELECT * FROM t1;
168
168
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
169
169
SELECT * from t2;
170
 
ERROR 42S02: Unknown table 'test.t2'
 
170
ERROR 42S02: Table 'test.t2' doesn't exist
171
171
DROP TABLE t1;
172
172
DROP TABLE IF EXISTS t2;
173
173
Warnings:
280
280
Level   Code    Message
281
281
Note    1050    Table 't1' already exists
282
282
Error   1062    Duplicate entry '3' for key 'PRIMARY'
283
 
select * from DATA_DICTIONARY.TABLE_DEFINITION_CACHE WHERE TABLE_COUNT AND TABLE_SCHEMA = SCHEMA() > 1 ORDER BY TABLE_SCHEMA, TABLE_NAME;
 
283
select * from DATA_DICTIONARY.TABLE_DEFINITION_CACHE WHERE TABLE_COUNT > 1 ORDER BY TABLE_SCHEMA, TABLE_NAME;
284
284
TABLE_SCHEMA    TABLE_NAME      VERSION TABLE_COUNT     IS_NAME_LOCKED
285
285
select * from t1;
286
286
a       b
362
362
select * from t2;
363
363
id      name
364
364
create table t3 like t1;
365
 
ERROR 42S01: Table 'test.t3' already exists
 
365
ERROR 42S01: Table 't3' already exists
366
366
create table t3 like mysqltest.t3;
367
 
ERROR 42S01: Table 'test.t3' already exists
 
367
ERROR 42S01: Table 't3' already exists
368
368
create table non_existing_database.t1 like t1;
369
369
ERROR 42000: Unknown schema 'non_existing_database'
370
 
create table t4 like non_existing_table;
371
 
ERROR 42S02: Unknown table 'test.non_existing_table'
 
370
create table t3 like non_existing_table;
 
371
ERROR 42S02: Table 'test.non_existing_table' doesn't exist
372
372
create temporary table t3 like t1;
373
 
ERROR 42S01: Table 'test.#t3' already exists
 
373
ERROR 42S01: Table 't3' already exists
374
374
drop table t1, t2, t3;
375
375
drop database mysqltest;
376
376
SET SESSION storage_engine="MEMORY";
441
441
2       -2      2       1825-12-14      a       2003-01-01 03:02:01     binary data
442
442
drop table t1, t2;
443
443
create table t1 (a int, b int, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), j date, k timestamp, l datetime, m enum('a','b'), o char(10));
444
 
SHOW CREATE TABLE t1;
445
 
Table   Create Table
446
 
t1      CREATE TABLE `t1` (
447
 
  `a` INT DEFAULT NULL,
448
 
  `b` INT DEFAULT NULL,
449
 
  `d` INT DEFAULT NULL,
450
 
  `e` BIGINT DEFAULT NULL,
451
 
  `f` DOUBLE(3,2) DEFAULT NULL,
452
 
  `g` DOUBLE(4,3) DEFAULT NULL,
453
 
  `h` DECIMAL(5,4) DEFAULT NULL,
454
 
  `j` DATE DEFAULT NULL,
455
 
  `k` TIMESTAMP NULL DEFAULT NULL,
456
 
  `l` DATETIME DEFAULT NULL,
457
 
  `m` ENUM('a','b') DEFAULT NULL,
458
 
  `o` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL
459
 
) ENGINE=InnoDB COLLATE = utf8_general_ci
460
444
create table t2 select ifnull(a,a), ifnull(b,b), ifnull(d,d), ifnull(e,e), ifnull(f,f), ifnull(g,g), ifnull(h,h), ifnull(j,j), ifnull(k,k), ifnull(l,l), ifnull(m,m), ifnull(o,o) from t1;
461
445
show create table t2;
462
446
Table   Create Table
682
666
) ENGINE=DEFAULT COLLATE = utf8_general_ci
683
667
drop table t1, t2;
684
668
create table t1 select * from t2;
685
 
ERROR 42S02: Unknown table 'test.t2'
 
669
ERROR 42S02: Table 'test.t2' doesn't exist
686
670
create table t1 select * from t1;
687
671
ERROR HY000: You can't specify target table 't1' for update in FROM clause
688
672
create table t1 select coalesce('a' collate utf8_swedish_ci,'b' collate utf8_bin);
710
694
1
711
695
drop temporary table t1;
712
696
select * from t1;
713
 
ERROR 42S02: Unknown table 'test.t1'
 
697
ERROR 42S02: Table 'test.t1' doesn't exist
714
698
drop table t1;
715
699
ERROR 42S02: Unknown table 't1'
716
700
create table t1 (upgrade int);
1460
1444
) ENGINE=DEFAULT COLLATE = utf8_general_ci
1461
1445
drop table имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48;
1462
1446
create table t1 like data_dictionary.processlist;
1463
 
Got one of the listed errors
 
1447
ERROR HY000: Can't create table 'test.t1' (errno: 1)
1464
1448
create table t1 like data_dictionary.processlist engine=innodb;
1465
1449
show create table t1;
1466
1450
Table   Create Table
1467
1451
t1      CREATE TABLE `t1` (
1468
1452
  `ID` BIGINT NOT NULL,
1469
 
  `USERNAME` VARCHAR(16) NOT NULL,
 
1453
  `USER` VARCHAR(16) NOT NULL,
1470
1454
  `HOST` VARCHAR(1025) NOT NULL,
1471
 
  `DB` VARCHAR(256) DEFAULT NULL,
 
1455
  `DB` VARCHAR(256) NOT NULL,
1472
1456
  `COMMAND` VARCHAR(16) NOT NULL,
1473
 
  `TIME` BIGINT UNSIGNED NOT NULL,
 
1457
  `TIME` BIGINT NOT NULL,
1474
1458
  `STATE` VARCHAR(256) DEFAULT NULL,
1475
 
  `INFO` VARCHAR(100) DEFAULT NULL,
1476
 
  `HAS_GLOBAL_LOCK` BOOLEAN NOT NULL
 
1459
  `INFO` VARCHAR(100) DEFAULT NULL
1477
1460
) ENGINE=InnoDB COLLATE = utf8_general_ci
1478
1461
drop table t1;
1479
1462
create temporary table t1 like data_dictionary.processlist;
1480
 
Got one of the listed errors
 
1463
ERROR HY000: Can't create table 'test.#t1' (errno: 138)
1481
1464
create temporary table t1 like data_dictionary.processlist engine=myisam;
1482
1465
show create table t1;
1483
1466
Table   Create Table
1484
1467
t1      CREATE TEMPORARY TABLE `t1` (
1485
1468
  `ID` BIGINT NOT NULL,
1486
 
  `USERNAME` VARCHAR(16) NOT NULL,
 
1469
  `USER` VARCHAR(16) NOT NULL,
1487
1470
  `HOST` VARCHAR(1025) NOT NULL,
1488
 
  `DB` VARCHAR(256) DEFAULT NULL,
 
1471
  `DB` VARCHAR(256) NOT NULL,
1489
1472
  `COMMAND` VARCHAR(16) NOT NULL,
1490
 
  `TIME` BIGINT UNSIGNED NOT NULL,
 
1473
  `TIME` BIGINT NOT NULL,
1491
1474
  `STATE` VARCHAR(256) DEFAULT NULL,
1492
 
  `INFO` VARCHAR(100) DEFAULT NULL,
1493
 
  `HAS_GLOBAL_LOCK` BOOLEAN NOT NULL
 
1475
  `INFO` VARCHAR(100) DEFAULT NULL
1494
1476
) ENGINE=MyISAM COLLATE = utf8_general_ci
1495
1477
drop table t1;
1496
1478