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
e43dff67
Commit
e43dff67
authored
Jul 27, 2005
by
ramil@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/usr/home/ram/work/mysql-5.0
parents
29cfa64f
efc8404a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
1 deletion
+38
-1
mysql-test/r/strict.result
mysql-test/r/strict.result
+20
-0
mysql-test/t/strict.test
mysql-test/t/strict.test
+14
-0
sql/field.cc
sql/field.cc
+4
-1
No files found.
mysql-test/r/strict.result
View file @
e43dff67
...
...
@@ -1259,6 +1259,26 @@ d
2000-10-01
drop table t1;
set @@sql_mode='traditional';
create table t1(a int, b timestamp);
alter table t1 add primary key(a);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0',
`b` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1(a int, b timestamp default 20050102030405);
alter table t1 add primary key(a);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL default '0',
`b` timestamp NOT NULL default '2005-01-02 03:04:05',
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1(a bit(2));
insert into t1 values(b'101');
ERROR 22001: Data too long for column 'a' at row 1
...
...
mysql-test/t/strict.test
View file @
e43dff67
...
...
@@ -1119,6 +1119,20 @@ update t1 set d = 1100;
select
*
from
t1
;
drop
table
t1
;
#
# Bug #11964: alter table with timestamp field
#
set
@@
sql_mode
=
'traditional'
;
create
table
t1
(
a
int
,
b
timestamp
);
alter
table
t1
add
primary
key
(
a
);
show
create
table
t1
;
drop
table
t1
;
create
table
t1
(
a
int
,
b
timestamp
default
20050102030405
);
alter
table
t1
add
primary
key
(
a
);
show
create
table
t1
;
drop
table
t1
;
#
# BIT fields
#
...
...
sql/field.cc
View file @
e43dff67
...
...
@@ -8468,7 +8468,10 @@ create_field::create_field(Field *old_field,Field *orig_field)
def
=
0
;
if
(
!
(
flags
&
(
NO_DEFAULT_VALUE_FLAG
|
BLOB_FLAG
))
&&
!
old_field
->
is_real_null
()
&&
old_field
->
ptr
&&
orig_field
)
old_field
->
ptr
&&
orig_field
&&
(
sql_type
!=
FIELD_TYPE_TIMESTAMP
||
/* set def only if */
old_field
->
table
->
timestamp_field
!=
old_field
||
/* timestamp field */
unireg_check
==
Field
::
TIMESTAMP_UN_FIELD
))
/* has default val */
{
char
buff
[
MAX_FIELD_WIDTH
],
*
pos
;
String
tmp
(
buff
,
sizeof
(
buff
),
charset
),
*
res
;
...
...
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