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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
c463d2cd
Commit
c463d2cd
authored
Sep 06, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1-maint
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.1-maint
parents
ec2512cf
43eeeac0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
1 deletion
+37
-1
mysql-test/r/func_time.result
mysql-test/r/func_time.result
+12
-0
mysql-test/t/func_time.test
mysql-test/t/func_time.test
+19
-0
sql/sql_string.cc
sql/sql_string.cc
+6
-1
No files found.
mysql-test/r/func_time.result
View file @
c463d2cd
...
@@ -695,6 +695,18 @@ t1 CREATE TABLE `t1` (
...
@@ -695,6 +695,18 @@ t1 CREATE TABLE `t1` (
`from_unixtime(1) + 0` double(23,6) default NULL
`from_unixtime(1) + 0` double(23,6) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
drop table t1;
SET NAMES latin1;
SET character_set_results = NULL;
SHOW VARIABLES LIKE 'character_set_results';
Variable_name Value
character_set_results
CREATE TABLE testBug8868 (field1 DATE, field2 VARCHAR(32) CHARACTER SET BINARY);
INSERT INTO testBug8868 VALUES ('2006-09-04', 'abcd');
SELECT DATE_FORMAT(field1,'%b-%e %l:%i%p') as fmtddate, field2 FROM testBug8868;
fmtddate field2
Sep-4 12:00AM abcd
DROP TABLE testBug8868;
SET NAMES DEFAULT;
(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%H') As H)
(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%H') As H)
union
union
(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%H') As H);
(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%H') As H);
...
...
mysql-test/t/func_time.test
View file @
c463d2cd
...
@@ -368,6 +368,25 @@ create table t1 select now() - now(), curtime() - curtime(),
...
@@ -368,6 +368,25 @@ create table t1 select now() - now(), curtime() - curtime(),
show
create
table
t1
;
show
create
table
t1
;
drop
table
t1
;
drop
table
t1
;
#
# 21913: DATE_FORMAT() Crashes mysql server if I use it through
# mysql-connector-j driver.
#
SET
NAMES
latin1
;
SET
character_set_results
=
NULL
;
SHOW
VARIABLES
LIKE
'character_set_results'
;
CREATE
TABLE
testBug8868
(
field1
DATE
,
field2
VARCHAR
(
32
)
CHARACTER
SET
BINARY
);
INSERT
INTO
testBug8868
VALUES
(
'2006-09-04'
,
'abcd'
);
SELECT
DATE_FORMAT
(
field1
,
'%b-%e %l:%i%p'
)
as
fmtddate
,
field2
FROM
testBug8868
;
DROP
TABLE
testBug8868
;
SET
NAMES
DEFAULT
;
#
#
# Bug #19844 time_format in Union truncates values
# Bug #19844 time_format in Union truncates values
#
#
...
...
sql/sql_string.cc
View file @
c463d2cd
...
@@ -248,6 +248,10 @@ bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *cs)
...
@@ -248,6 +248,10 @@ bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *cs)
0 No conversion needed
0 No conversion needed
1 Either character set conversion or adding leading zeros
1 Either character set conversion or adding leading zeros
(e.g. for UCS-2) must be done
(e.g. for UCS-2) must be done
NOTE
to_cs may be NULL for "no conversion" if the system variable
character_set_results is NULL.
*/
*/
bool
String
::
needs_conversion
(
uint32
arg_length
,
bool
String
::
needs_conversion
(
uint32
arg_length
,
...
@@ -256,7 +260,8 @@ bool String::needs_conversion(uint32 arg_length,
...
@@ -256,7 +260,8 @@ bool String::needs_conversion(uint32 arg_length,
uint32
*
offset
)
uint32
*
offset
)
{
{
*
offset
=
0
;
*
offset
=
0
;
if
((
to_cs
==
&
my_charset_bin
)
||
if
(
!
to_cs
||
(
to_cs
==
&
my_charset_bin
)
||
(
to_cs
==
from_cs
)
||
(
to_cs
==
from_cs
)
||
my_charset_same
(
from_cs
,
to_cs
)
||
my_charset_same
(
from_cs
,
to_cs
)
||
((
from_cs
==
&
my_charset_bin
)
&&
((
from_cs
==
&
my_charset_bin
)
&&
...
...
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