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
fc7a1bfa
Commit
fc7a1bfa
authored
Jan 03, 2003
by
venu@myvenu.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix date,time,timestamp,year - binary protocol
parent
5f4a7c19
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
362 additions
and
56 deletions
+362
-56
libmysql/libmysql.c
libmysql/libmysql.c
+347
-39
sql/field.cc
sql/field.cc
+1
-3
sql/protocol.cc
sql/protocol.cc
+14
-14
No files found.
libmysql/libmysql.c
View file @
fc7a1bfa
This diff is collapsed.
Click to expand it.
sql/field.cc
View file @
fc7a1bfa
...
@@ -3257,9 +3257,7 @@ int Field_year::store(longlong nr)
...
@@ -3257,9 +3257,7 @@ int Field_year::store(longlong nr)
bool
Field_year
::
send_binary
(
Protocol
*
protocol
)
bool
Field_year
::
send_binary
(
Protocol
*
protocol
)
{
{
ulonglong
tmp
=
Field_year
::
val_int
();
ulonglong
tmp
=
Field_year
::
val_int
();
TIME
tm
;
return
protocol
->
store_short
(
tmp
);
tm
.
year
=
(
uint32
)
tmp
;
return
protocol
->
store_date
(
&
tm
);
}
}
double
Field_year
::
val_real
(
void
)
double
Field_year
::
val_real
(
void
)
...
...
sql/protocol.cc
View file @
fc7a1bfa
...
@@ -852,7 +852,8 @@ bool Protocol_prep::store_short(longlong from)
...
@@ -852,7 +852,8 @@ bool Protocol_prep::store_short(longlong from)
{
{
#ifndef DEBUG_OFF
#ifndef DEBUG_OFF
DBUG_ASSERT
(
field_types
==
0
||
DBUG_ASSERT
(
field_types
==
0
||
field_types
[
field_pos
]
==
MYSQL_TYPE_SHORT
);
field_types
[
field_pos
]
==
MYSQL_TYPE_SHORT
||
field_types
[
field_pos
]
==
MYSQL_TYPE_YEAR
);
#endif
#endif
field_pos
++
;
field_pos
++
;
char
*
to
=
packet
->
prep_append
(
2
,
PACKET_BUFFET_EXTRA_ALLOC
);
char
*
to
=
packet
->
prep_append
(
2
,
PACKET_BUFFET_EXTRA_ALLOC
);
...
@@ -939,7 +940,6 @@ bool Protocol_prep::store(TIME *tm)
...
@@ -939,7 +940,6 @@ bool Protocol_prep::store(TIME *tm)
{
{
#ifndef DEBUG_OFF
#ifndef DEBUG_OFF
DBUG_ASSERT
(
field_types
==
0
||
DBUG_ASSERT
(
field_types
==
0
||
field_types
[
field_pos
]
==
MYSQL_TYPE_YEAR
||
field_types
[
field_pos
]
==
MYSQL_TYPE_DATETIME
||
field_types
[
field_pos
]
==
MYSQL_TYPE_DATETIME
||
field_types
[
field_pos
]
==
MYSQL_TYPE_DATE
||
field_types
[
field_pos
]
==
MYSQL_TYPE_DATE
||
field_types
[
field_pos
]
==
MYSQL_TYPE_TIMESTAMP
);
field_types
[
field_pos
]
==
MYSQL_TYPE_TIMESTAMP
);
...
@@ -950,11 +950,11 @@ bool Protocol_prep::store(TIME *tm)
...
@@ -950,11 +950,11 @@ bool Protocol_prep::store(TIME *tm)
pos
=
buff
+
1
;
pos
=
buff
+
1
;
int2store
(
pos
,
tm
->
year
);
int2store
(
pos
,
tm
->
year
);
int2store
(
pos
+
2
,
tm
->
month
)
;
pos
[
2
]
=
(
uchar
)
tm
->
month
;
int2store
(
pos
+
3
,
tm
->
day
)
;
pos
[
3
]
=
(
uchar
)
tm
->
day
;
int2store
(
pos
+
4
,
tm
->
hour
)
;
pos
[
4
]
=
(
uchar
)
tm
->
hour
;
int2store
(
pos
+
5
,
tm
->
minute
)
;
pos
[
5
]
=
(
uchar
)
tm
->
minute
;
int2store
(
pos
+
6
,
tm
->
second
)
;
pos
[
6
]
=
(
uchar
)
tm
->
second
;
int4store
(
pos
+
7
,
tm
->
second_part
);
int4store
(
pos
+
7
,
tm
->
second_part
);
if
(
tm
->
second_part
)
if
(
tm
->
second_part
)
length
=
11
;
length
=
11
;
...
@@ -987,15 +987,15 @@ bool Protocol_prep::store_time(TIME *tm)
...
@@ -987,15 +987,15 @@ bool Protocol_prep::store_time(TIME *tm)
field_pos
++
;
field_pos
++
;
pos
=
buff
+
1
;
pos
=
buff
+
1
;
pos
[
0
]
=
tm
->
neg
?
1
:
0
;
pos
[
0
]
=
tm
->
neg
?
1
:
0
;
int4store
(
pos
+
1
,
tm
->
day
);
int4store
(
pos
+
1
,
tm
->
day
);
int2store
(
pos
+
5
,
tm
->
hour
)
;
pos
[
5
]
=
(
uchar
)
tm
->
hour
;
int2store
(
pos
+
7
,
tm
->
minute
)
;
pos
[
6
]
=
(
uchar
)
tm
->
minute
;
int2store
(
pos
+
9
,
tm
->
second
)
;
pos
[
7
]
=
(
uchar
)
tm
->
second
;
int4store
(
pos
+
11
,
tm
->
second_part
);
int4store
(
pos
+
8
,
tm
->
second_part
);
if
(
tm
->
second_part
)
if
(
tm
->
second_part
)
length
=
1
4
;
length
=
1
1
;
else
if
(
tm
->
hour
||
tm
->
minute
||
tm
->
second
||
tm
->
day
)
else
if
(
tm
->
hour
||
tm
->
minute
||
tm
->
second
||
tm
->
day
)
length
=
10
;
length
=
8
;
else
else
length
=
0
;
length
=
0
;
buff
[
0
]
=
(
char
)
length
;
// Length is stored first
buff
[
0
]
=
(
char
)
length
;
// Length is stored first
...
...
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