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
2cb72dcc
Commit
2cb72dcc
authored
Mar 24, 2016
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.0' into 10.1
parents
43745018
f6d99a0d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
2 deletions
+44
-2
mysys/ma_dyncol.c
mysys/ma_dyncol.c
+1
-1
unittest/mysys/ma_dyncol-t.c
unittest/mysys/ma_dyncol-t.c
+43
-1
No files found.
mysys/ma_dyncol.c
View file @
2cb72dcc
...
...
@@ -4248,7 +4248,7 @@ mariadb_dyncol_unpack(DYNAMIC_COLUMN *str,
{
*
names
=
my_malloc
(
sizeof
(
LEX_STRING
)
*
header
.
column_count
+
DYNCOL_NUM_CHAR
*
header
.
column_count
,
MYF
(
0
));
nm
=
(
char
*
)(
names
+
sizeof
(
LEX_STRING
)
*
header
.
column_count
);
nm
=
(
char
*
)(
(
*
names
)
+
header
.
column_count
);
}
else
{
...
...
unittest/mysys/ma_dyncol-t.c
View file @
2cb72dcc
...
...
@@ -691,13 +691,54 @@ err:
mariadb_dyncol_free
(
&
str2
);
}
static
void
test_mdev_9773
()
{
int
rc
;
uint
i
;
uint
num_keys
[
5
]
=
{
1
,
2
,
3
,
4
,
5
};
char
const
*
strval
[]
=
{
"Val1"
,
"Val2"
,
"Val3"
,
"Val4"
,
"Val5"
};
DYNAMIC_COLUMN_VALUE
vals
[
5
];
DYNAMIC_COLUMN
dynstr
;
uint
unpack_columns
=
0
;
MYSQL_LEX_STRING
*
unpack_keys
=
0
;
DYNAMIC_COLUMN_VALUE
*
unpack_vals
=
0
;
for
(
i
=
0
;
i
<
5
;
i
++
)
{
vals
[
i
].
type
=
DYN_COL_STRING
;
vals
[
i
].
x
.
string
.
value
.
str
=
(
char
*
)
strval
[
i
];
vals
[
i
].
x
.
string
.
value
.
length
=
strlen
(
strval
[
i
]);
vals
[
i
].
x
.
string
.
charset
=
&
my_charset_latin1
;
}
mariadb_dyncol_init
(
&
dynstr
);
/* create numeric */
rc
=
mariadb_dyncol_create_many_num
(
&
dynstr
,
5
,
num_keys
,
vals
,
1
);
if
(
rc
==
ER_DYNCOL_OK
)
rc
=
mariadb_dyncol_unpack
(
&
dynstr
,
&
unpack_columns
,
&
unpack_keys
,
&
unpack_vals
);
ok
(
rc
==
ER_DYNCOL_OK
&&
unpack_columns
==
5
,
"5 fields unpacked"
);
for
(
i
=
0
;
i
<
unpack_columns
;
i
++
)
{
ok
(
memcmp
(
unpack_vals
[
i
].
x
.
string
.
value
.
str
,
vals
[
i
].
x
.
string
.
value
.
str
,
vals
[
i
].
x
.
string
.
value
.
length
)
==
0
,
"unpack %u"
,
i
);
}
my_free
(
unpack_keys
);
my_free
(
unpack_vals
);
mariadb_dyncol_free
(
&
dynstr
);
}
int
main
(
int
argc
__attribute__
((
unused
)),
char
**
argv
)
{
uint
i
;
char
*
big_string
=
(
char
*
)
malloc
(
1024
*
1024
);
MY_INIT
(
argv
[
0
]);
plan
(
6
2
);
plan
(
6
8
);
if
(
!
big_string
)
exit
(
1
);
...
...
@@ -830,6 +871,7 @@ int main(int argc __attribute__((unused)), char **argv)
}
test_mdev_4994
();
test_mdev_4995
();
test_mdev_9773
();
my_end
(
0
);
return
exit_status
();
...
...
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