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
3c07ed14
Commit
3c07ed14
authored
May 04, 2018
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '5.5' into 10.0
parents
04b1e61d
1d58d184
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
sql-common/client.c
sql-common/client.c
+15
-7
No files found.
sql-common/client.c
View file @
3c07ed14
...
...
@@ -1347,7 +1347,9 @@ unpack_fields(MYSQL *mysql, MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
{
uchar
*
pos
;
/* fields count may be wrong */
DBUG_ASSERT
((
uint
)
(
field
-
result
)
<
fields
);
if
(
field
-
result
>=
fields
)
goto
err
;
cli_fetch_lengths
(
&
lengths
[
0
],
row
->
data
,
default_value
?
8
:
7
);
field
->
catalog
=
strmake_root
(
alloc
,(
char
*
)
row
->
data
[
0
],
lengths
[
0
]);
field
->
db
=
strmake_root
(
alloc
,(
char
*
)
row
->
data
[
1
],
lengths
[
1
]);
...
...
@@ -1365,12 +1367,7 @@ unpack_fields(MYSQL *mysql, MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
/* Unpack fixed length parts */
if
(
lengths
[
6
]
!=
12
)
{
/* malformed packet. signal an error. */
free_rows
(
data
);
/* Free old data */
set_mysql_error
(
mysql
,
CR_MALFORMED_PACKET
,
unknown_sqlstate
);
DBUG_RETURN
(
0
);
}
goto
err
;
pos
=
(
uchar
*
)
row
->
data
[
6
];
field
->
charsetnr
=
uint2korr
(
pos
);
...
...
@@ -1397,6 +1394,8 @@ unpack_fields(MYSQL *mysql, MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
/* old protocol, for backward compatibility */
for
(
row
=
data
->
data
;
row
;
row
=
row
->
next
,
field
++
)
{
if
(
field
-
result
>=
fields
)
goto
err
;
cli_fetch_lengths
(
&
lengths
[
0
],
row
->
data
,
default_value
?
6
:
5
);
field
->
org_table
=
field
->
table
=
strdup_root
(
alloc
,(
char
*
)
row
->
data
[
0
]);
field
->
name
=
strdup_root
(
alloc
,(
char
*
)
row
->
data
[
1
]);
...
...
@@ -1433,8 +1432,17 @@ unpack_fields(MYSQL *mysql, MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
}
}
#endif
/* DELETE_SUPPORT_OF_4_0_PROTOCOL */
if
(
field
-
result
<
fields
)
goto
err
;
free_rows
(
data
);
/* Free old data */
DBUG_RETURN
(
result
);
err:
/* malformed packet. signal an error. */
free_rows
(
data
);
free_root
(
alloc
,
MYF
(
0
));
set_mysql_error
(
mysql
,
CR_MALFORMED_PACKET
,
unknown_sqlstate
);
DBUG_RETURN
(
0
);
}
/* Read all rows (fields or data) from server */
...
...
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