create table t1 (bandID MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, payoutID SMALLINT UNSIGNED NOT NULL);
21
create table t1 (bandID INT UNSIGNED NOT NULL PRIMARY KEY, payoutID SMALLINT UNSIGNED NOT NULL);
22
22
insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7,12),(8,12);
23
23
alter table t1 add column new_col int, order by payoutid,bandid;
24
24
select * from t1;
52
52
ALTER TABLE t1 CHANGE NAME NAME CHAR(80) not null;
53
53
SHOW FULL COLUMNS FROM t1;
54
54
Field Type Collation Null Key Default Extra Privileges Comment
55
GROUP_ID int(10) unsigned NULL NO PRI 0 #
56
LANG_ID smallint(5) unsigned NULL NO PRI 0 #
55
GROUP_ID int(10) unsigned NULL NO PRI NULL #
56
LANG_ID smallint(5) unsigned NULL NO PRI NULL #
57
57
NAME char(80) latin1_swedish_ci NO MUL NULL #
58
58
DROP TABLE t1;
59
59
create table t1 (n int);
298
298
t1 0 a 2 b A 300 NULL NULL YES BTREE
299
299
t1 1 b 1 b A 100 NULL NULL YES BTREE
300
300
drop table t1;
301
CREATE TABLE t1 (i int(10), index(i) );
302
ALTER TABLE t1 DISABLE KEYS;
303
INSERT DELAYED INTO t1 VALUES(1),(2),(3);
304
ALTER TABLE t1 ENABLE KEYS;
305
drop table t1;
306
301
CREATE TABLE t1 (
307
302
Host varchar(16) binary NOT NULL default '',
308
303
User varchar(16) binary NOT NULL default '',
397
392
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
398
393
t1 MyISAM 10 Fixed 1 37 X X X X X X X X latin1_swedish_ci NULL
399
394
drop table t1;
400
create table t1 (a int not null, b int not null, c int not null, d int not null, e int not null, f int not null, g int not null, h int not null,i int not null, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
395
create table t1 (a int not null default 0, b int not null default 0, c int not null default 0, d int not null default 0, e int not null default 0, f int not null default 0, g int not null default 0, h int not null default 0,i int not null default 0, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
401
396
insert into t1 (a) values(1);
402
Warnings:
403
Warning 1364 Field 'b' doesn't have a default value
404
Warning 1364 Field 'c' doesn't have a default value
405
Warning 1364 Field 'd' doesn't have a default value
406
Warning 1364 Field 'e' doesn't have a default value
407
Warning 1364 Field 'f' doesn't have a default value
408
Warning 1364 Field 'g' doesn't have a default value
409
Warning 1364 Field 'h' doesn't have a default value
410
Warning 1364 Field 'i' doesn't have a default value
411
397
show table status like 't1';
412
398
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
413
399
t1 MyISAM 10 Fixed 1 37 X X X X X X X X latin1_swedish_ci NULL
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(section + 12)' at line 1
798
784
alter table table_24562 order by length(title);
799
785
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(title)' at line 1
800
alter table table_24562 order by (select 12 from dual);
801
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(select 12 from dual)' at line 1
802
786
alter table table_24562 order by no_such_col;
803
787
ERROR 42S22: Unknown column 'no_such_col' in 'order clause'
insert into t1 values ('def'),('abc'),('hij'),('3r4f');
856
821
select * from t1;
910
875
engine=myisam default charset=latin1;
911
876
alter table t1 change t t text;
912
877
drop table t1;
913
CREATE TABLE t1 (a varchar(500));
914
ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b);
915
SHOW CREATE TABLE t1;
916
Table Create Table
917
t1 CREATE TABLE `t1` (
918
`a` varchar(500) DEFAULT NULL,
919
`b` geometry NOT NULL,
920
SPATIAL KEY `b` (`b`)
921
) ENGINE=MyISAM DEFAULT CHARSET=latin1
922
ALTER TABLE t1 ADD KEY(b(50));
923
SHOW CREATE TABLE t1;
924
Table Create Table
925
t1 CREATE TABLE `t1` (
926
`a` varchar(500) DEFAULT NULL,
927
`b` geometry NOT NULL,
928
SPATIAL KEY `b` (`b`),
929
KEY `b_2` (`b`(50))
930
) ENGINE=MyISAM DEFAULT CHARSET=latin1
931
ALTER TABLE t1 ADD c POINT;
932
SHOW CREATE TABLE t1;
933
Table Create Table
934
t1 CREATE TABLE `t1` (
935
`a` varchar(500) DEFAULT NULL,
936
`b` geometry NOT NULL,
937
`c` point DEFAULT NULL,
938
SPATIAL KEY `b` (`b`),
939
KEY `b_2` (`b`(50))
940
) ENGINE=MyISAM DEFAULT CHARSET=latin1
941
CREATE TABLE t2 (a INT, KEY (a(20)));
942
ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys
943
ALTER TABLE t1 ADD d INT;
944
ALTER TABLE t1 ADD KEY (d(20));
945
ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys
946
ALTER TABLE t1 ADD e GEOMETRY NOT NULL, ADD SPATIAL KEY (e(30));
947
ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys