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
fc608351
Commit
fc608351
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
659be375
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 @
fc608351
...
@@ -2511,7 +2511,8 @@ row_sel_field_store_in_mysql_format(
...
@@ -2511,7 +2511,8 @@ row_sel_field_store_in_mysql_format(
ut_ad
(
len
!=
UNIV_SQL_NULL
);
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
/* Convert integer data from Innobase to a little-endian
format, sign bit restored to normal */
format, sign bit restored to normal */
...
@@ -2531,10 +2532,11 @@ row_sel_field_store_in_mysql_format(
...
@@ -2531,10 +2532,11 @@ row_sel_field_store_in_mysql_format(
}
}
ut_ad
(
templ
->
mysql_col_len
==
len
);
ut_ad
(
templ
->
mysql_col_len
==
len
);
}
else
if
(
templ
->
type
==
DATA_VARCHAR
break
;
||
templ
->
type
==
DATA_VARMYSQL
||
templ
->
type
==
DATA_BINARY
)
{
case
DATA_VARCHAR
:
case
DATA_VARMYSQL
:
case
DATA_BINARY
:
field_end
=
dest
+
templ
->
mysql_col_len
;
field_end
=
dest
+
templ
->
mysql_col_len
;
if
(
templ
->
mysql_type
==
DATA_MYSQL_TRUE_VARCHAR
)
{
if
(
templ
->
mysql_type
==
DATA_MYSQL_TRUE_VARCHAR
)
{
...
@@ -2585,13 +2587,17 @@ row_sel_field_store_in_mysql_format(
...
@@ -2585,13 +2587,17 @@ row_sel_field_store_in_mysql_format(
memset
(
pad_ptr
,
0x20
,
field_end
-
pad_ptr
);
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
/* Store a pointer to the BLOB buffer to dest: the BLOB was
already copied to the buffer in row_sel_store_mysql_rec */
already copied to the buffer in row_sel_store_mysql_rec */
row_mysql_store_blob_ref
(
dest
,
templ
->
mysql_col_len
,
data
,
row_mysql_store_blob_ref
(
dest
,
templ
->
mysql_col_len
,
data
,
len
);
len
);
}
else
if
(
templ
->
type
==
DATA_MYSQL
)
{
break
;
case
DATA_MYSQL
:
memcpy
(
dest
,
data
,
len
);
memcpy
(
dest
,
data
,
len
);
ut_ad
(
templ
->
mysql_col_len
>=
len
);
ut_ad
(
templ
->
mysql_col_len
>=
len
);
...
@@ -2612,16 +2618,23 @@ row_sel_field_store_in_mysql_format(
...
@@ -2612,16 +2618,23 @@ row_sel_field_store_in_mysql_format(
memset
(
dest
+
len
,
0x20
,
templ
->
mysql_col_len
-
len
);
memset
(
dest
+
len
,
0x20
,
templ
->
mysql_col_len
-
len
);
}
}
}
else
{
break
;
ut_ad
(
templ
->
type
==
DATA_CHAR
||
templ
->
type
==
DATA_FIXBINARY
default:
/*|| templ->type == DATA_SYS_CHILD
#ifdef UNIV_DEBUG
|| templ->type == DATA_SYS*/
case
DATA_SYS_CHILD
:
||
templ
->
type
==
DATA_FLOAT
case
DATA_SYS
:
||
templ
->
type
==
DATA_DOUBLE
/* These column types should never be shipped to MySQL. */
||
templ
->
type
==
DATA_DECIMAL
);
ut_ad
(
0
);
ut_ad
(
templ
->
mysql_col_len
==
len
);
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
);
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