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
df88e3c9
Commit
df88e3c9
authored
Sep 27, 2007
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: row_sel_field_store_in_mysql_format(): Replace
if-else with switch.
parent
2de2d45f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
15 deletions
+28
-15
row/row0sel.c
row/row0sel.c
+28
-15
No files found.
row/row0sel.c
View file @
df88e3c9
...
...
@@ -2511,7 +2511,8 @@ row_sel_field_store_in_mysql_format(
ut_ad
(
len
!=
UNIV_SQL_NULL
);
if
(
templ
->
type
==
DATA_INT
)
{
switch
(
templ
->
type
)
{
case
DATA_INT
:
/* Convert integer data from Innobase to a little-endian
format, sign bit restored to normal */
...
...
@@ -2531,10 +2532,11 @@ row_sel_field_store_in_mysql_format(
}
ut_ad
(
templ
->
mysql_col_len
==
len
);
}
else
if
(
templ
->
type
==
DATA_VARCHAR
||
templ
->
type
==
DATA_VARMYSQL
||
templ
->
type
==
DATA_BINARY
)
{
break
;
case
DATA_VARCHAR
:
case
DATA_VARMYSQL
:
case
DATA_BINARY
:
field_end
=
dest
+
templ
->
mysql_col_len
;
if
(
templ
->
mysql_type
==
DATA_MYSQL_TRUE_VARCHAR
)
{
...
...
@@ -2585,13 +2587,17 @@ row_sel_field_store_in_mysql_format(
memset
(
pad_ptr
,
0x20
,
field_end
-
pad_ptr
);
}
}
else
if
(
templ
->
type
==
DATA_BLOB
)
{
break
;
case
DATA_BLOB
:
/* Store a pointer to the BLOB buffer to dest: the BLOB was
already copied to the buffer in row_sel_store_mysql_rec */
row_mysql_store_blob_ref
(
dest
,
templ
->
mysql_col_len
,
data
,
len
);
}
else
if
(
templ
->
type
==
DATA_MYSQL
)
{
break
;
case
DATA_MYSQL
:
memcpy
(
dest
,
data
,
len
);
ut_ad
(
templ
->
mysql_col_len
>=
len
);
...
...
@@ -2612,16 +2618,23 @@ row_sel_field_store_in_mysql_format(
memset
(
dest
+
len
,
0x20
,
templ
->
mysql_col_len
-
len
);
}
}
else
{
ut_ad
(
templ
->
type
==
DATA_CHAR
||
templ
->
type
==
DATA_FIXBINARY
/*|| templ->type == DATA_SYS_CHILD
|| templ->type == DATA_SYS*/
||
templ
->
type
==
DATA_FLOAT
||
templ
->
type
==
DATA_DOUBLE
||
templ
->
type
==
DATA_DECIMAL
);
ut_ad
(
templ
->
mysql_col_len
==
len
);
break
;
default:
#ifdef UNIV_DEBUG
case
DATA_SYS_CHILD
:
case
DATA_SYS
:
/* These column types should never be shipped to MySQL. */
ut_ad
(
0
);
case
DATA_CHAR
:
case
DATA_FIXBINARY
:
case
DATA_FLOAT
:
case
DATA_DOUBLE
:
case
DATA_DECIMAL
:
/* Above are the valid column types for MySQL data. */
#endif
/* UNIV_DEBUG */
ut_ad
(
templ
->
mysql_col_len
==
len
);
memcpy
(
dest
,
data
,
len
);
}
}
...
...
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