Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
7f841713
Commit
7f841713
authored
Feb 07, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test for SHOW CREATE
parent
4c7fa215
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
0 deletions
+91
-0
mysql-test/r/show_check.result
mysql-test/r/show_check.result
+56
-0
mysql-test/t/show_check.test
mysql-test/t/show_check.test
+35
-0
No files found.
mysql-test/r/show_check.result
View file @
7f841713
...
@@ -156,6 +156,62 @@ f double(5,0) YES NULL
...
@@ -156,6 +156,62 @@ f double(5,0) YES NULL
h float(3,2) YES NULL
h float(3,2) YES NULL
i float(3,0) YES NULL
i float(3,0) YES NULL
drop table t1;
drop table t1;
create table t1 (
type_bool bool not null,
type_tiny tinyint not null auto_increment primary key,
type_short smallint(3),
type_mediumint mediumint,
type_bigint bigint,
type_decimal decimal(5,2),
type_numeric numeric(5,2),
empty_char char(0),
type_char char(2),
type_varchar varchar(10),
type_timestamp timestamp not null,
type_date date not null,
type_time time not null,
type_datetime datetime not null,
type_year year,
type_enum enum ('red', 'green', 'blue'),
type_set enum ('red', 'green', 'blue'),
type_tinyblob tinyblob,
type_blob blob,
type_medium_blob mediumblob,
type_long_blob longblob,
index(type_short)
) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" TYPE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed CHARSET=latin1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`type_bool` tinyint(1) NOT NULL default '0',
`type_tiny` tinyint(4) NOT NULL auto_increment,
`type_short` smallint(3) default NULL,
`type_mediumint` mediumint(9) default NULL,
`type_bigint` bigint(20) default NULL,
`type_decimal` decimal(5,2) default NULL,
`type_numeric` decimal(5,2) default NULL,
`empty_char` char(0) default NULL,
`type_char` char(2) default NULL,
`type_varchar` varchar(10) default NULL,
`type_timestamp` timestamp(14) NOT NULL,
`type_date` date NOT NULL default '0000-00-00',
`type_time` time NOT NULL default '00:00:00',
`type_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
`type_year` year(4) default NULL,
`type_enum` enum('red','green','blue') default NULL,
`type_set` enum('red','green','blue') default NULL,
`type_tinyblob` tinyblob,
`type_blob` blob,
`type_medium_blob` mediumblob,
`type_long_blob` longblob,
PRIMARY KEY (`type_tiny`),
KEY `type_short` (`type_short`)
) TYPE=MyISAM MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test'
insert into t1 (type_timestamp) values ("2003-02-07 10:00:01");
select * from t1;
type_bool type_tiny type_short type_mediumint type_bigint type_decimal type_numeric empty_char type_char type_varchar type_timestamp type_date type_time type_datetime type_year type_enum type_set type_tinyblob type_blob type_medium_blob type_long_blob
0 1 NULL NULL NULL NULL NULL NULL NULL NULL 20030207100001 0000-00-00 00:00:00 0000-00-00 00:00:00 NULL NULL NULL NULL NULL NULL NULL
drop table t1;
create table t1 (c decimal, d double, f float, r real);
create table t1 (c decimal, d double, f float, r real);
show columns from t1;
show columns from t1;
Field Type Null Key Default Extra
Field Type Null Key Default Extra
...
...
mysql-test/t/show_check.test
View file @
7f841713
...
@@ -80,6 +80,41 @@ create table t1 (a decimal(9,2), b decimal (9,0), e double(9,2), f double(5,0),
...
@@ -80,6 +80,41 @@ create table t1 (a decimal(9,2), b decimal (9,0), e double(9,2), f double(5,0),
show
columns
from
t1
;
show
columns
from
t1
;
drop
table
t1
;
drop
table
t1
;
#
# Do a create table that tries to cover all types and options
#
create
table
t1
(
type_bool
bool
not
null
,
type_tiny
tinyint
not
null
auto_increment
primary
key
,
type_short
smallint
(
3
),
type_mediumint
mediumint
,
type_bigint
bigint
,
type_decimal
decimal
(
5
,
2
),
type_numeric
numeric
(
5
,
2
),
empty_char
char
(
0
),
type_char
char
(
2
),
type_varchar
varchar
(
10
),
type_timestamp
timestamp
not
null
,
type_date
date
not
null
,
type_time
time
not
null
,
type_datetime
datetime
not
null
,
type_year
year
,
type_enum
enum
(
'red'
,
'green'
,
'blue'
),
type_set
enum
(
'red'
,
'green'
,
'blue'
),
type_tinyblob
tinyblob
,
type_blob
blob
,
type_medium_blob
mediumblob
,
type_long_blob
longblob
,
index
(
type_short
)
)
AVG_ROW_LENGTH
=
10
CHECKSUM
=
1
COMMENT
=
"test"
TYPE
=
MYISAM
MIN_ROWS
=
10
MAX_ROWS
=
100
PACK_KEYS
=
1
DELAY_KEY_WRITE
=
1
ROW_FORMAT
=
fixed
CHARSET
=
latin1
;
# Not tested above: RAID_# UNION INSERT_METHOD DATA DIRECTORY INDEX DIRECTORY
show
create
table
t1
;
insert
into
t1
(
type_timestamp
)
values
(
"2003-02-07 10:00:01"
);
select
*
from
t1
;
drop
table
t1
;
# Check auto conversions of types
# Check auto conversions of types
create
table
t1
(
c
decimal
,
d
double
,
f
float
,
r
real
);
create
table
t1
(
c
decimal
,
d
double
,
f
float
,
r
real
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment