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
fad244c5
Commit
fad244c5
authored
Mar 22, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk@192.168.21.1:mysql-4.1
into mysql.com:/home/hf/work/mrg/mysql-4.1-opt
parents
d7e4ad63
bd268daa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
14 deletions
+24
-14
libmysqld/lib_sql.cc
libmysqld/lib_sql.cc
+8
-14
mysql-test/r/type_datetime.result
mysql-test/r/type_datetime.result
+3
-0
mysql-test/t/type_datetime.test
mysql-test/t/type_datetime.test
+6
-0
sql/item_timefunc.h
sql/item_timefunc.h
+7
-0
No files found.
libmysqld/lib_sql.cc
View file @
fad244c5
...
...
@@ -69,10 +69,14 @@ void embedded_get_error(MYSQL *mysql)
static
void
emb_free_rows
(
THD
*
thd
)
{
if
(
!
thd
->
data
)
return
;
if
(
thd
->
current_stmt
)
free_root
(
&
thd
->
data
->
alloc
,
MYF
(
0
));
else
free_rows
(
thd
->
data
);
thd
->
data
=
NULL
;
}
...
...
@@ -86,11 +90,8 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
THD
*
thd
=
(
THD
*
)
mysql
->
thd
;
NET
*
net
=
&
mysql
->
net
;
if
(
thd
->
data
)
{
emb_free_rows
(
thd
);
thd
->
data
=
0
;
}
emb_free_rows
(
thd
);
/* Check that we are calling the client functions in right order */
if
(
mysql
->
status
!=
MYSQL_STATUS_READY
)
{
...
...
@@ -143,13 +144,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
static
void
emb_flush_use_result
(
MYSQL
*
mysql
)
{
MYSQL_DATA
*
data
=
((
THD
*
)(
mysql
->
thd
))
->
data
;
if
(
data
)
{
free_rows
(
data
);
((
THD
*
)(
mysql
->
thd
))
->
data
=
NULL
;
}
emb_free_rows
((
THD
*
)
(
mysql
->
thd
));
}
static
MYSQL_DATA
*
...
...
@@ -304,8 +299,7 @@ int emb_unbuffered_fetch(MYSQL *mysql, char **row)
static
void
emb_free_embedded_thd
(
MYSQL
*
mysql
)
{
THD
*
thd
=
(
THD
*
)
mysql
->
thd
;
if
(
thd
->
data
)
emb_free_rows
(
thd
);
emb_free_rows
(
thd
);
thread_count
--
;
delete
thd
;
mysql
->
thd
=
0
;
...
...
mysql-test/r/type_datetime.result
View file @
fad244c5
...
...
@@ -166,3 +166,6 @@ dt
0000-00-00 00:00:00
0000-00-00 00:00:00
drop table t1;
select cast('2006-12-05 22:10:10' as datetime) + 0;
cast('2006-12-05 22:10:10' as datetime) + 0
20061205221010.000000
mysql-test/t/type_datetime.test
View file @
fad244c5
...
...
@@ -113,4 +113,10 @@ insert into t1 values ("00-00-00"), ("00-00-00 00:00:00");
select
*
from
t1
;
drop
table
t1
;
#
# Bug #16546 DATETIME+0 not always coerced the same way
#
select
cast
(
'2006-12-05 22:10:10'
as
datetime
)
+
0
;
# End of 4.1 tests
sql/item_timefunc.h
View file @
fad244c5
...
...
@@ -751,12 +751,19 @@ class Item_datetime_typecast :public Item_typecast_maybe_null
String
*
val_str
(
String
*
str
);
const
char
*
cast_type
()
const
{
return
"datetime"
;
}
enum_field_types
field_type
()
const
{
return
MYSQL_TYPE_DATETIME
;
}
void
fix_length_and_dec
()
{
Item_typecast_maybe_null
::
fix_length_and_dec
();
decimals
=
DATETIME_DEC
;
}
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
{
return
(
new
Field_datetime
(
maybe_null
,
name
,
t_arg
,
&
my_charset_bin
));
}
bool
result_as_longlong
()
{
return
TRUE
;
}
longlong
val_int
();
double
val
()
{
return
(
double
)
val_int
();
}
};
class
Item_func_makedate
:
public
Item_str_func
...
...
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