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
cc78e2d9
Commit
cc78e2d9
authored
Feb 09, 2004
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure that result from date_format() is binary
Removed warnings from test suite
parent
3e35cce5
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
22 additions
and
144 deletions
+22
-144
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+2
-1
mysql-test/r/date_formats.result
mysql-test/r/date_formats.result
+0
-2
mysql-test/r/type_decimal.result
mysql-test/r/type_decimal.result
+0
-123
mysql-test/r/warnings.result
mysql-test/r/warnings.result
+0
-3
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+1
-0
mysql-test/t/date_formats.test
mysql-test/t/date_formats.test
+2
-2
mysql-test/t/type_decimal.test
mysql-test/t/type_decimal.test
+2
-2
mysql-test/t/warnings.test
mysql-test/t/warnings.test
+2
-2
sql/field.cc
sql/field.cc
+2
-3
sql/item_timefunc.cc
sql/item_timefunc.cc
+8
-3
strings/ctype-simple.c
strings/ctype-simple.c
+3
-3
No files found.
mysql-test/r/ctype_utf8.result
View file @
cc78e2d9
...
...
@@ -73,7 +73,7 @@ create table t1 select date_format("2004-01-19 10:10:10", "%Y-%m-%d");
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`date_format("2004-01-19 10:10:10", "%Y-%m-%d")` char(10)
character set utf8
default NULL
`date_format("2004-01-19 10:10:10", "%Y-%m-%d")` char(10)
binary
default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
date_format("2004-01-19 10:10:10", "%Y-%m-%d")
...
...
@@ -87,3 +87,4 @@ Warning 1264 Data truncated for column 's1' at row 1
select s1,hex(s1),char_length(s1),octet_length(s1) from t1;
s1 hex(s1) char_length(s1) octet_length(s1)
D0B0 1 2
drop table t1;
mysql-test/r/date_formats.result
View file @
cc78e2d9
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
SHOW GLOBAL VARIABLES LIKE "%_format%";
Variable_name Value
date_format %d.%m.%Y
...
...
mysql-test/r/type_decimal.result
View file @
cc78e2d9
This diff is collapsed.
Click to expand it.
mysql-test/r/warnings.result
View file @
cc78e2d9
drop table if exists t1, t2;
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 't2'
SET SQL_WARNINGS=1;
create table t1 (a int);
insert into t1 values (1);
...
...
mysql-test/t/ctype_utf8.test
View file @
cc78e2d9
...
...
@@ -60,3 +60,4 @@ set names koi8r;
create
table
t1
(
s1
char
(
1
)
character
set
utf8
);
insert
into
t1
values
(
_koi8r
''
);
select
s1
,
hex
(
s1
),
char_length
(
s1
),
octet_length
(
s1
)
from
t1
;
drop
table
t1
;
mysql-test/t/date_formats.test
View file @
cc78e2d9
...
...
@@ -2,9 +2,9 @@
# Test of date format functions
#
--
disable
-
warnings
--
disable
_
warnings
drop
table
if
exists
t1
;
--
enable
-
warnings
--
enable
_
warnings
SHOW
GLOBAL
VARIABLES
LIKE
"%_format%"
;
SHOW
SESSION
VARIABLES
LIKE
"%_format%"
;
...
...
mysql-test/t/type_decimal.test
View file @
cc78e2d9
...
...
@@ -248,7 +248,7 @@ CREATE TABLE t1 (a_dec DECIMAL(-1,1));
#
# Zero prepend overflow bug
#
--
disable
-
warnings
--
disable
_
warnings
create
table
t1
(
a
decimal
(
7
,
3
));
insert
into
t1
values
(
'1'
),(
'+1'
),(
'-1'
),(
'0000000001'
),(
'+0000000001'
),(
'-0000000001'
),(
'10'
),(
'+10'
),(
'-10'
),(
'0000000010'
),(
'+0000000010'
),(
'-0000000010'
),(
'100'
),(
'+100'
),(
'-100'
),(
'0000000100'
),(
'+0000000100'
),(
'-0000000100'
),(
'1000'
),(
'+1000'
),(
'-1000'
),(
'0000001000'
),(
'+0000001000'
),(
'-0000001000'
),(
'10000'
),(
'+10000'
),(
'-10000'
),(
'0000010000'
),(
'+0000010000'
),(
'-0000010000'
),(
'100000'
),(
'+100000'
),(
'-100000'
),(
'0000100000'
),(
'+0000100000'
),(
'-0000100000'
),(
'1000000'
),(
'+1000000'
),(
'-1000000'
),(
'0001000000'
),(
'+0001000000'
),(
'-0001000000'
),(
'10000000'
),(
'+10000000'
),(
'-10000000'
),(
'0010000000'
),(
'+0010000000'
),(
'-0010000000'
),(
'100000000'
),(
'+100000000'
),(
'-100000000'
),(
'0100000000'
),(
'+0100000000'
),(
'-0100000000'
),(
'1000000000'
),(
'+1000000000'
),(
'-1000000000'
),(
'1000000000'
),(
'+1000000000'
),(
'-1000000000'
);
select
*
from
t1
;
...
...
@@ -259,6 +259,6 @@ select * from t1;
drop
table
t1
;
create
table
t1
(
a
decimal
(
7
,
3
)
zerofill
);
insert
into
t1
values
(
'1'
),(
'+1'
),(
'-1'
),(
'0000000001'
),(
'+0000000001'
),(
'-0000000001'
),(
'10'
),(
'+10'
),(
'-10'
),(
'0000000010'
),(
'+0000000010'
),(
'-0000000010'
),(
'100'
),(
'+100'
),(
'-100'
),(
'0000000100'
),(
'+0000000100'
),(
'-0000000100'
),(
'1000'
),(
'+1000'
),(
'-1000'
),(
'0000001000'
),(
'+0000001000'
),(
'-0000001000'
),(
'10000'
),(
'+10000'
),(
'-10000'
),(
'0000010000'
),(
'+0000010000'
),(
'-0000010000'
),(
'100000'
),(
'+100000'
),(
'-100000'
),(
'0000100000'
),(
'+0000100000'
),(
'-0000100000'
),(
'1000000'
),(
'+1000000'
),(
'-1000000'
),(
'0001000000'
),(
'+0001000000'
),(
'-0001000000'
),(
'10000000'
),(
'+10000000'
),(
'-10000000'
),(
'0010000000'
),(
'+0010000000'
),(
'-0010000000'
),(
'100000000'
),(
'+100000000'
),(
'-100000000'
),(
'0100000000'
),(
'+0100000000'
),(
'-0100000000'
),(
'1000000000'
),(
'+1000000000'
),(
'-1000000000'
),(
'1000000000'
),(
'+1000000000'
),(
'-1000000000'
);
--
enable
-
warnings
--
enable
_
warnings
select
*
from
t1
;
drop
table
t1
;
mysql-test/t/warnings.test
View file @
cc78e2d9
#
# Test some warnings
#
--
disable
-
warnings
--
disable
_
warnings
drop
table
if
exists
t1
,
t2
;
--
enable
-
warnings
--
enable
_
warnings
SET
SQL_WARNINGS
=
1
;
create
table
t1
(
a
int
);
...
...
sql/field.cc
View file @
cc78e2d9
...
...
@@ -4072,7 +4072,7 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
}
/*
Make sure we don't break a mult
ybi
te sequence
Make sure we don't break a mult
iby
te sequence
as well as don't copy a malformed data.
*/
copy_length
=
field_charset
->
cset
->
wellformedlen
(
field_charset
,
...
...
@@ -4084,8 +4084,7 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
field_charset
->
cset
->
fill
(
field_charset
,
ptr
+
copy_length
,
field_length
-
copy_length
,
' '
);
if
(
current_thd
->
count_cuted_fields
&&
(
copy_length
<
length
))
if
((
copy_length
<
length
)
&&
current_thd
->
count_cuted_fields
)
{
// Check if we loosed some info
const
char
*
end
=
from
+
length
;
from
+=
copy_length
;
...
...
sql/item_timefunc.cc
View file @
cc78e2d9
...
...
@@ -1283,16 +1283,21 @@ longlong Item_func_sec_to_time::val_int()
void
Item_func_date_format
::
fix_length_and_dec
()
{
decimals
=
0
;
collation
.
set
(
&
my_charset_bin
);
if
(
args
[
1
]
->
type
()
==
STRING_ITEM
)
{
// Optimize the normal case
fixed_length
=
1
;
max_length
=
format_length
(((
Item_string
*
)
args
[
1
])
->
const_string
())
*
collation
.
collation
->
mbmaxlen
;
/*
The result is a binary string (no reason to use collation->mbmaxlen
This is becasue make_date_time() only returns binary strings
*/
max_length
=
format_length
(((
Item_string
*
)
args
[
1
])
->
const_string
());
}
else
{
fixed_length
=
0
;
max_length
=
args
[
1
]
->
max_length
*
10
*
collation
.
collation
->
mbmaxlen
;
/* The result is a binary string (no reason to use collation->mbmaxlen */
max_length
=
args
[
1
]
->
max_length
*
10
;
set_if_smaller
(
max_length
,
MAX_BLOB_WIDTH
);
}
maybe_null
=
1
;
// If wrong date
...
...
strings/ctype-simple.c
View file @
cc78e2d9
...
...
@@ -1021,11 +1021,11 @@ uint my_charpos_8bit(CHARSET_INFO *cs __attribute__((unused)),
}
uint
my_wellformedlen_8bit
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
const
char
*
b
,
const
char
*
e
,
const
char
*
start
,
const
char
*
e
nd
,
uint
nchars
)
{
uint
nbytes
=
e
-
b
;
uint
nbytes
=
(
uint
)
(
end
-
start
)
;
return
nbytes
<
nchars
?
nbytes
:
nchars
;
}
...
...
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