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
7ab30f5d
Commit
7ab30f5d
authored
Jan 29, 2021
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update bson_get_item modified: bsonudf.cpp
parent
848a1a61
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
storage/connect/bsonudf.cpp
storage/connect/bsonudf.cpp
+8
-9
No files found.
storage/connect/bsonudf.cpp
View file @
7ab30f5d
...
@@ -3693,8 +3693,8 @@ char *bson_get_item(UDF_INIT *initid, UDF_ARGS *args, char *result,
...
@@ -3693,8 +3693,8 @@ char *bson_get_item(UDF_INIT *initid, UDF_ARGS *args, char *result,
{
{
char
*
path
,
*
str
=
NULL
;
char
*
path
,
*
str
=
NULL
;
PBVAL
jvp
;
PBVAL
jvp
;
PBJNX
bxp
=
NULL
;
PGLOBAL
g
=
(
PGLOBAL
)
initid
->
ptr
;
PGLOBAL
g
=
(
PGLOBAL
)
initid
->
ptr
;
BJNX
bnx
(
g
,
NULL
,
TYPE_STRING
,
initid
->
max_length
);
if
(
g
->
N
)
{
if
(
g
->
N
)
{
str
=
(
char
*
)
g
->
Activityp
;
str
=
(
char
*
)
g
->
Activityp
;
...
@@ -3707,8 +3707,6 @@ char *bson_get_item(UDF_INIT *initid, UDF_ARGS *args, char *result,
...
@@ -3707,8 +3707,6 @@ char *bson_get_item(UDF_INIT *initid, UDF_ARGS *args, char *result,
PUSH_WARNING
(
"CheckMemory error"
);
PUSH_WARNING
(
"CheckMemory error"
);
goto
fin
;
goto
fin
;
}
else
{
}
else
{
BJNX
bnx
(
g
);
jvp
=
bnx
.
MakeValue
(
args
,
0
,
true
);
jvp
=
bnx
.
MakeValue
(
args
,
0
,
true
);
if
(
g
->
Mrr
)
{
// First argument is a constant
if
(
g
->
Mrr
)
{
// First argument is a constant
...
@@ -3722,16 +3720,16 @@ char *bson_get_item(UDF_INIT *initid, UDF_ARGS *args, char *result,
...
@@ -3722,16 +3720,16 @@ char *bson_get_item(UDF_INIT *initid, UDF_ARGS *args, char *result,
jvp
=
(
PBVAL
)
g
->
Xchk
;
jvp
=
(
PBVAL
)
g
->
Xchk
;
path
=
MakePSZ
(
g
,
args
,
1
);
path
=
MakePSZ
(
g
,
args
,
1
);
bxp
=
new
(
g
)
BJNX
(
g
,
jvp
,
TYPE_STRING
,
initid
->
max_length
);
if
(
bxp
->
SetJpath
(
g
,
path
,
true
))
{
if
(
bnx
.
SetJpath
(
g
,
path
,
true
))
{
PUSH_WARNING
(
g
->
Message
);
goto
fin
;
goto
fin
;
}
else
}
else
bxp
->
ReadValue
(
g
);
jvp
=
bnx
.
GetRowValue
(
g
,
jvp
,
0
);
if
(
!
bxp
->
GetValue
()
->
IsNull
())
if
(
!
bnx
.
IsJson
(
jvp
))
{
str
=
bxp
->
GetValue
()
->
GetCharValue
();
strcpy
(
g
->
Message
,
"Not a Json item"
);
}
else
str
=
bnx
.
Serialize
(
g
,
jvp
,
NULL
,
0
);
if
(
initid
->
const_item
)
if
(
initid
->
const_item
)
// Keep result of constant function
// Keep result of constant function
...
@@ -3739,6 +3737,7 @@ char *bson_get_item(UDF_INIT *initid, UDF_ARGS *args, char *result,
...
@@ -3739,6 +3737,7 @@ char *bson_get_item(UDF_INIT *initid, UDF_ARGS *args, char *result,
fin:
fin:
if
(
!
str
)
{
if
(
!
str
)
{
PUSH_WARNING
(
g
->
Message
);
*
is_null
=
1
;
*
is_null
=
1
;
*
res_length
=
0
;
*
res_length
=
0
;
}
else
}
else
...
...
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