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
f325a92b
Commit
f325a92b
authored
Aug 06, 2004
by
dlenev@brandersnatch.localdomain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #4491 "timestamp(19) doesn't work".
We should allow 19 as length of newly created TIMESTAMP fields.
parent
1097805c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
1 deletion
+29
-1
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
mysql-test/r/type_timestamp.result
mysql-test/r/type_timestamp.result
+12
-0
mysql-test/t/type_timestamp.test
mysql-test/t/type_timestamp.test
+11
-0
sql/sql_parse.cc
sql/sql_parse.cc
+5
-1
No files found.
BitKeeper/etc/logging_ok
View file @
f325a92b
...
...
@@ -20,6 +20,7 @@ bell@sanja.is.com.ua
bk@admin.bk
carsten@tsort.bitbybit.dk
davida@isil.mysql.com
dlenev@brandersnatch.localdomain
dlenev@build.mysql.com
dlenev@mysql.com
gerberb@ou800.zenez.com
...
...
mysql-test/r/type_timestamp.result
View file @
f325a92b
...
...
@@ -167,3 +167,15 @@ ts1 ts2
2001-09-09 04:46:40 0000-00-00 00:00:00
2001-09-09 04:46:40 0000-00-00 00:00:00
drop table t1;
create table t1 (ts timestamp(19));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`ts` timestamp(19) NOT NULL
) TYPE=MyISAM
set TIMESTAMP=1000000000;
insert into t1 values ();
select * from t1;
ts
2001-09-09 04:46:40
drop table t1;
mysql-test/t/type_timestamp.test
View file @
f325a92b
...
...
@@ -105,3 +105,14 @@ insert into t1 values ();
insert
into
t1
values
(
DEFAULT
,
DEFAULT
);
select
*
from
t1
;
drop
table
t1
;
#
# Test for bug #4491, TIMESTAMP(19) should be possible to create and not
# only read in 4.0
#
create
table
t1
(
ts
timestamp
(
19
));
show
create
table
t1
;
set
TIMESTAMP
=
1000000000
;
insert
into
t1
values
();
select
*
from
t1
;
drop
table
t1
;
sql/sql_parse.cc
View file @
f325a92b
...
...
@@ -3231,8 +3231,12 @@ bool add_field_to_list(char *field_name, enum_field_types type,
case
FIELD_TYPE_TIMESTAMP
:
if
(
!
length
)
new_field
->
length
=
14
;
// Full date YYYYMMDDHHMMSS
else
else
if
(
new_field
->
length
!=
19
)
{
/*
We support only even TIMESTAMP lengths less or equal than 14
and 19 as length of 4.1 compatible representation.
*/
new_field
->
length
=
((
new_field
->
length
+
1
)
/
2
)
*
2
;
/* purecov: inspected */
new_field
->
length
=
min
(
new_field
->
length
,
14
);
/* purecov: inspected */
}
...
...
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