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
fef194fc
Commit
fef194fc
authored
Mar 12, 2003
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for --new option (Timestamp in YYYY-MM-DD HH:MM:SS format)
parent
d57c2019
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
sql/field.cc
sql/field.cc
+25
-0
sql/field.h
sql/field.h
+2
-1
No files found.
sql/field.cc
View file @
fef194fc
...
...
@@ -2421,6 +2421,14 @@ void Field_double::sql_type(String &res) const
** by handler.cc. The form->timestamp points at the automatic timestamp.
****************************************************************************/
enum
Item_result
Field_timestamp
::
result_type
()
const
{
return
(
!
current_thd
->
variables
.
new_mode
&&
(
field_length
==
8
||
field_length
==
14
)
?
INT_RESULT
:
STRING_RESULT
);
}
Field_timestamp
::
Field_timestamp
(
char
*
ptr_arg
,
uint32
len_arg
,
enum
utype
unireg_check_arg
,
const
char
*
field_name_arg
,
...
...
@@ -2783,6 +2791,23 @@ void Field_timestamp::set_time()
longstore
(
ptr
,
tmp
);
}
/*
This is an exact copy of Field_num except that 'length' is depending
on --new mode
*/
void
Field_timestamp
::
make_field
(
Send_field
*
field
)
{
field
->
table_name
=
table_name
;
field
->
col_name
=
field_name
;
/* If --new, then we are using "YYYY-MM-DD HH:MM:SS" format */
field
->
length
=
current_thd
->
variables
.
new_mode
?
19
:
field_length
;
field
->
type
=
type
();
field
->
flags
=
table
->
maybe_null
?
(
flags
&
~
NOT_NULL_FLAG
)
:
flags
;
field
->
decimals
=
dec
;
}
/****************************************************************************
** time type
** In string context: HH:MM:SS
...
...
sql/field.h
View file @
fef194fc
...
...
@@ -541,7 +541,7 @@ class Field_timestamp :public Field_num {
Field_timestamp
(
char
*
ptr_arg
,
uint32
len_arg
,
enum
utype
unireg_check_arg
,
const
char
*
field_name_arg
,
struct
st_table
*
table_arg
);
enum
Item_result
result_type
()
const
{
return
field_length
==
8
||
field_length
==
14
?
INT_RESULT
:
STRING_RESULT
;
}
enum
Item_result
result_type
()
const
;
enum_field_types
type
()
const
{
return
FIELD_TYPE_TIMESTAMP
;}
enum
ha_base_keytype
key_type
()
const
{
return
HA_KEYTYPE_ULONG_INT
;
}
void
store
(
const
char
*
to
,
uint
length
);
...
...
@@ -575,6 +575,7 @@ class Field_timestamp :public Field_num {
void
fill_and_store
(
char
*
from
,
uint
len
);
bool
get_date
(
TIME
*
ltime
,
bool
fuzzydate
);
bool
get_time
(
TIME
*
ltime
);
void
make_field
(
Send_field
*
field
);
};
...
...
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