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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
de7e53d5
Commit
de7e53d5
authored
Aug 08, 2006
by
holyfoot/hf@mysql.com/deer.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug #20910 (NOT NULL reported as NULL for TIMESTAMP)
we intentionally reported that for TIMESTAMPS, which isn't right
parent
eab37de0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
12 deletions
+36
-12
mysql-test/r/type_timestamp.result
mysql-test/r/type_timestamp.result
+24
-9
mysql-test/t/type_timestamp.test
mysql-test/t/type_timestamp.test
+11
-0
sql/sql_show.cc
sql/sql_show.cc
+1
-3
No files found.
mysql-test/r/type_timestamp.result
View file @
de7e53d5
...
...
@@ -201,9 +201,9 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
t1 timestamp
YES
2003-01-01 00:00:00
t1 timestamp
NO
2003-01-01 00:00:00
t2 datetime YES NULL
t3 timestamp
YES
0000-00-00 00:00:00
t3 timestamp
NO
0000-00-00 00:00:00
drop table t1;
create table t1 (t1 timestamp default now(), t2 datetime, t3 timestamp);
SET TIMESTAMP=1000000002;
...
...
@@ -225,9 +225,9 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
t1 timestamp
YES
CURRENT_TIMESTAMP
t1 timestamp
NO
CURRENT_TIMESTAMP
t2 datetime YES NULL
t3 timestamp
YES
0000-00-00 00:00:00
t3 timestamp
NO
0000-00-00 00:00:00
drop table t1;
create table t1 (t1 timestamp default '2003-01-01 00:00:00' on update now(), t2 datetime);
SET TIMESTAMP=1000000004;
...
...
@@ -251,7 +251,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
t1 timestamp
YES
2003-01-01 00:00:00
t1 timestamp
NO
2003-01-01 00:00:00
t2 datetime YES NULL
drop table t1;
create table t1 (t1 timestamp default now() on update now(), t2 datetime);
...
...
@@ -276,7 +276,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
t1 timestamp
YES
CURRENT_TIMESTAMP
t1 timestamp
NO
CURRENT_TIMESTAMP
t2 datetime YES NULL
drop table t1;
create table t1 (t1 timestamp, t2 datetime, t3 timestamp);
...
...
@@ -302,9 +302,9 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
t1 timestamp
YES
CURRENT_TIMESTAMP
t1 timestamp
NO
CURRENT_TIMESTAMP
t2 datetime YES NULL
t3 timestamp
YES
0000-00-00 00:00:00
t3 timestamp
NO
0000-00-00 00:00:00
drop table t1;
create table t1 (t1 timestamp default current_timestamp on update current_timestamp, t2 datetime);
SET TIMESTAMP=1000000009;
...
...
@@ -328,7 +328,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
t1 timestamp
YES
CURRENT_TIMESTAMP
t1 timestamp
NO
CURRENT_TIMESTAMP
t2 datetime YES NULL
delete from t1;
insert into t1 values ('2004-04-01 00:00:00', '2004-04-01 00:00:00');
...
...
@@ -493,3 +493,18 @@ a b c
6 NULL 2006-06-06 06:06:06
drop table t1;
set time_zone= @@global.time_zone;
CREATE TABLE t1 (
`id` int(11) NOT NULL auto_increment,
`username` varchar(80) NOT NULL default '',
`posted_on` timestamp NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
show fields from t1;
Field Type Null Key Default Extra
id int(11) NO PRI NULL auto_increment
username varchar(80) NO
posted_on timestamp NO 0000-00-00 00:00:00
select is_nullable from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='t1' and COLUMN_NAME='posted_on';
is_nullable
NO
drop table t1;
mysql-test/t/type_timestamp.test
View file @
de7e53d5
...
...
@@ -328,3 +328,14 @@ drop table t1;
# Restore timezone to default
set
time_zone
=
@@
global
.
time_zone
;
CREATE
TABLE
t1
(
`id`
int
(
11
)
NOT
NULL
auto_increment
,
`username`
varchar
(
80
)
NOT
NULL
default
''
,
`posted_on`
timestamp
NOT
NULL
default
'0000-00-00 00:00:00'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
AUTO_INCREMENT
=
1
;
show
fields
from
t1
;
select
is_nullable
from
INFORMATION_SCHEMA
.
COLUMNS
where
TABLE_NAME
=
't1'
and
COLUMN_NAME
=
'posted_on'
;
drop
table
t1
;
sql/sql_show.cc
View file @
de7e53d5
...
...
@@ -2713,9 +2713,7 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
table
->
field
[
5
]
->
store
(
""
,
0
,
cs
);
table
->
field
[
5
]
->
set_notnull
();
}
pos
=
(
byte
*
)
((
flags
&
NOT_NULL_FLAG
)
&&
field
->
type
()
!=
FIELD_TYPE_TIMESTAMP
?
"NO"
:
"YES"
);
pos
=
(
byte
*
)
((
flags
&
NOT_NULL_FLAG
)
?
"NO"
:
"YES"
);
table
->
field
[
6
]
->
store
((
const
char
*
)
pos
,
strlen
((
const
char
*
)
pos
),
cs
);
is_blob
=
(
field
->
type
()
==
FIELD_TYPE_BLOB
);
...
...
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