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
73f0c5d7
Commit
73f0c5d7
authored
Mar 29, 2007
by
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/ram/work/mysql-5.0-maint
into mysql.com:/home/ram/work/b26359/b26359.5.0
parents
024be23a
e3c34c9c
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
259 additions
and
226 deletions
+259
-226
mysql-test/r/strict.result
mysql-test/r/strict.result
+41
-0
mysql-test/r/type_date.result
mysql-test/r/type_date.result
+1
-1
mysql-test/r/type_year.result
mysql-test/r/type_year.result
+12
-0
mysql-test/t/strict.test
mysql-test/t/strict.test
+50
-0
mysql-test/t/type_year.test
mysql-test/t/type_year.test
+9
-1
sql/field.cc
sql/field.cc
+141
-222
sql/field.h
sql/field.h
+5
-2
No files found.
mysql-test/r/strict.result
View file @
73f0c5d7
...
...
@@ -1346,3 +1346,44 @@ t1 CREATE TABLE `t1` (
`i` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='123456789*123456789*123456789*123456789*123456789*123456789*'
drop table t1;
set sql_mode= 'traditional';
create table t1(col1 tinyint, col2 tinyint unsigned,
col3 smallint, col4 smallint unsigned,
col5 mediumint, col6 mediumint unsigned,
col7 int, col8 int unsigned,
col9 bigint, col10 bigint unsigned);
insert into t1(col1) values('-');
ERROR HY000: Incorrect integer value: '-' for column 'col1' at row 1
insert into t1(col2) values('+');
ERROR HY000: Incorrect integer value: '+' for column 'col2' at row 1
insert into t1(col3) values('-');
ERROR HY000: Incorrect integer value: '-' for column 'col3' at row 1
insert into t1(col4) values('+');
ERROR HY000: Incorrect integer value: '+' for column 'col4' at row 1
insert into t1(col5) values('-');
ERROR HY000: Incorrect integer value: '-' for column 'col5' at row 1
insert into t1(col6) values('+');
ERROR HY000: Incorrect integer value: '+' for column 'col6' at row 1
insert into t1(col7) values('-');
ERROR HY000: Incorrect integer value: '-' for column 'col7' at row 1
insert into t1(col8) values('+');
ERROR HY000: Incorrect integer value: '+' for column 'col8' at row 1
insert into t1(col9) values('-');
ERROR HY000: Incorrect integer value: '-' for column 'col9' at row 1
insert into t1(col10) values('+');
ERROR HY000: Incorrect integer value: '+' for column 'col10' at row 1
drop table t1;
set sql_mode='traditional';
create table t1(a year);
insert into t1 values ('-');
ERROR HY000: Incorrect integer value: '-' for column 'a' at row 1
insert into t1 values ('+');
ERROR HY000: Incorrect integer value: '+' for column 'a' at row 1
insert into t1 values ('');
ERROR HY000: Incorrect integer value: '' for column 'a' at row 1
insert into t1 values ('2000a');
ERROR 01000: Data truncated for column 'a' at row 1
insert into t1 values ('2E3x');
ERROR 01000: Data truncated for column 'a' at row 1
drop table t1;
End of 5.0 tests
mysql-test/r/type_date.result
View file @
73f0c5d7
...
...
@@ -99,7 +99,7 @@ DROP TABLE t1, t2, t3;
CREATE TABLE t1 (y YEAR);
INSERT INTO t1 VALUES ('abc');
Warnings:
Warning 1
264 Out of range value adjusted
for column 'y' at row 1
Warning 1
366 Incorrect integer value: 'abc'
for column 'y' at row 1
SELECT * FROM t1;
y
0000
...
...
mysql-test/r/type_year.result
View file @
73f0c5d7
...
...
@@ -34,3 +34,15 @@ select if(y = now(), 1, 0) from t1;
if(y = now(), 1, 0)
1
drop table t1;
create table t1(a year);
insert into t1 values (2000.5), ('2000.5'), ('2001a'), ('2.001E3');
Warnings:
Warning 1265 Data truncated for column 'a' at row 3
select * from t1;
a
2001
2001
2001
2001
drop table t1;
End of 5.0 tests
mysql-test/t/strict.test
View file @
73f0c5d7
...
...
@@ -1200,3 +1200,53 @@ create table t1 (i int)
comment
'123456789*123456789*123456789*123456789*123456789*123456789*'
;
show
create
table
t1
;
drop
table
t1
;
#
# Bug #26359: Strings becoming truncated and converted to numbers under STRICT mode
#
set
sql_mode
=
'traditional'
;
create
table
t1
(
col1
tinyint
,
col2
tinyint
unsigned
,
col3
smallint
,
col4
smallint
unsigned
,
col5
mediumint
,
col6
mediumint
unsigned
,
col7
int
,
col8
int
unsigned
,
col9
bigint
,
col10
bigint
unsigned
);
--
error
1366
insert
into
t1
(
col1
)
values
(
'-'
);
--
error
1366
insert
into
t1
(
col2
)
values
(
'+'
);
--
error
1366
insert
into
t1
(
col3
)
values
(
'-'
);
--
error
1366
insert
into
t1
(
col4
)
values
(
'+'
);
--
error
1366
insert
into
t1
(
col5
)
values
(
'-'
);
--
error
1366
insert
into
t1
(
col6
)
values
(
'+'
);
--
error
1366
insert
into
t1
(
col7
)
values
(
'-'
);
--
error
1366
insert
into
t1
(
col8
)
values
(
'+'
);
--
error
1366
insert
into
t1
(
col9
)
values
(
'-'
);
--
error
1366
insert
into
t1
(
col10
)
values
(
'+'
);
drop
table
t1
;
#
# Bug #27176: Assigning a string to an year column has unexpected results
#
set
sql_mode
=
'traditional'
;
create
table
t1
(
a
year
);
--
error
1366
insert
into
t1
values
(
'-'
);
--
error
1366
insert
into
t1
values
(
'+'
);
--
error
1366
insert
into
t1
values
(
''
);
--
error
1265
insert
into
t1
values
(
'2000a'
);
--
error
1265
insert
into
t1
values
(
'2E3x'
);
drop
table
t1
;
--
echo
End
of
5.0
tests
mysql-test/t/type_year.test
View file @
73f0c5d7
...
...
@@ -21,4 +21,12 @@ insert into t1 values (now());
select
if
(
y
=
now
(),
1
,
0
)
from
t1
;
drop
table
t1
;
# End of 4.1 tests
#
# Bug #27176: Assigning a string to an year column has unexpected results
#
create
table
t1
(
a
year
);
insert
into
t1
values
(
2000.5
),
(
'2000.5'
),
(
'2001a'
),
(
'2.001E3'
);
select
*
from
t1
;
drop
table
t1
;
--
echo
End
of
5.0
tests
sql/field.cc
View file @
73f0c5d7
This diff is collapsed.
Click to expand it.
sql/field.h
View file @
73f0c5d7
...
...
@@ -306,8 +306,6 @@ class Field
virtual
void
set_derivation
(
enum
Derivation
derivation_arg
)
{
}
bool
set_warning
(
MYSQL_ERROR
::
enum_warning_level
,
unsigned
int
code
,
int
cuted_increment
);
bool
check_int
(
const
char
*
str
,
int
length
,
const
char
*
int_end
,
CHARSET_INFO
*
cs
);
void
set_datetime_warning
(
MYSQL_ERROR
::
enum_warning_level
,
uint
code
,
const
char
*
str
,
uint
str_len
,
timestamp_type
ts_type
,
int
cuted_increment
);
...
...
@@ -369,6 +367,11 @@ class Field_num :public Field {
bool
eq_def
(
Field
*
field
);
int
store_decimal
(
const
my_decimal
*
);
my_decimal
*
val_decimal
(
my_decimal
*
);
int
check_int
(
CHARSET_INFO
*
cs
,
const
char
*
str
,
int
length
,
const
char
*
int_end
,
int
error
);
bool
get_int
(
CHARSET_INFO
*
cs
,
const
char
*
from
,
uint
len
,
longlong
*
rnd
,
ulonglong
unsigned_max
,
longlong
signed_min
,
longlong
signed_max
);
};
...
...
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