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
d788225b
Commit
d788225b
authored
Feb 05, 2021
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bson_object_grp inverted args. Modified: storage/connect/bsonudf.cpp and bson_udf.result
parent
ca630041
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
storage/connect/bsonudf.cpp
storage/connect/bsonudf.cpp
+1
-1
storage/connect/mysql-test/connect/r/bson_udf.result
storage/connect/mysql-test/connect/r/bson_udf.result
+6
-6
No files found.
storage/connect/bsonudf.cpp
View file @
d788225b
...
@@ -3019,7 +3019,7 @@ void bson_object_grp_add(UDF_INIT *initid, UDF_ARGS *args, char*, char*)
...
@@ -3019,7 +3019,7 @@ void bson_object_grp_add(UDF_INIT *initid, UDF_ARGS *args, char*, char*)
PBVAL
bop
=
(
PBVAL
)
g
->
Activityp
;
PBVAL
bop
=
(
PBVAL
)
g
->
Activityp
;
if
(
g
->
N
--
>
0
)
if
(
g
->
N
--
>
0
)
bxp
->
SetKeyValue
(
bop
,
bxp
->
MakeValue
(
args
,
0
),
MakePSZ
(
g
,
args
,
1
));
bxp
->
SetKeyValue
(
bop
,
bxp
->
MakeValue
(
args
,
1
),
MakePSZ
(
g
,
args
,
0
));
}
// end of bson_object_grp_add
}
// end of bson_object_grp_add
...
...
storage/connect/mysql-test/connect/r/bson_udf.result
View file @
d788225b
...
@@ -280,13 +280,13 @@ SELECT Bson_Object_Grp(SALARY) FROM t3;
...
@@ -280,13 +280,13 @@ SELECT Bson_Object_Grp(SALARY) FROM t3;
ERROR HY000: Can't initialize function 'bson_object_grp'; This function requires 2 arguments (key, value)
ERROR HY000: Can't initialize function 'bson_object_grp'; This function requires 2 arguments (key, value)
SELECT Bson_Object_Grp(NAME, SALARY) FROM t3;
SELECT Bson_Object_Grp(NAME, SALARY) FROM t3;
Bson_Object_Grp(NAME, SALARY)
Bson_Object_Grp(NAME, SALARY)
{"
":"MARTIN","ffffp@":"KITTY"
}
{"
BANCROFT":9600.00,"SMITH":9000.00,"MERCHANT":8700.00,"FUNNIGUY":8500.00,"BUGHAPPY":8500.00,"BIGHEAD":8000.00,"SHRINKY":7500.00,"WALTER":7400.00,"FODDERMAN":7000.00,"TONGHO":6800.00,"SHORTSIGHT":5500.00,"MESSIFUL":5000.50,"HONEY":4900.00,"GOOSEPEN":4700.00,"CHERRY":4500.00,"MONAPENNY":3800.00,"KITTY":3000.45,"PLUMHEAD":2800.00,"STRONG":23000.00,"BULLOZER":14800.00,"WERTHER":14500.00,"QUINN":14000.00,"ORELLY":13400.00,"BIGHORN":11000.00,"BROWNY":10500.00,"WHEELFOR":10030.00,"MARTIN":10000.00
}
SELECT Bson_Make_Object(DEPARTMENT, Bson_Object_Grp(NAME, SALARY) "Json_SALARIES") FROM t3 GROUP BY DEPARTMENT;
SELECT Bson_Make_Object(DEPARTMENT, Bson_Object_Grp(NAME, SALARY) "Json_SALARIES") FROM t3 GROUP BY DEPARTMENT;
Bson_Make_Object(DEPARTMENT, Bson_Object_Grp(NAME, SALARY) "Json_SALARIES")
Bson_Make_Object(DEPARTMENT, Bson_Object_Grp(NAME, SALARY) "Json_SALARIES")
{"DEPARTMENT":"0021","SALARIES":{"
":"SHORTSIGHT"
}}
{"DEPARTMENT":"0021","SALARIES":{"
STRONG":23000.00,"SHORTSIGHT":5500.00
}}
{"DEPARTMENT":"0318","SALARIES":{"
":"WHEELFOR"
}}
{"DEPARTMENT":"0318","SALARIES":{"
BANCROFT":9600.00,"PLUMHEAD":2800.00,"HONEY":4900.00,"TONGHO":6800.00,"WALTER":7400.00,"SHRINKY":7500.00,"WERTHER":14500.00,"MERCHANT":8700.00,"WHEELFOR":10030.00
}}
{"DEPARTMENT":"0319","SALARIES":{"
":"GOOSEPEN","ffffp@":"KITTY"
}}
{"DEPARTMENT":"0319","SALARIES":{"
BULLOZER":14800.00,"QUINN":14000.00,"BROWNY":10500.00,"KITTY":3000.45,"MONAPENNY":3800.00,"MARTIN":10000.00,"FUNNIGUY":8500.00,"BUGHAPPY":8500.00,"FODDERMAN":7000.00,"MESSIFUL":5000.50,"GOOSEPEN":4700.00
}}
{"DEPARTMENT":"2452","SALARIES":{"
":"CHERRY"
}}
{"DEPARTMENT":"2452","SALARIES":{"
BIGHEAD":8000.00,"ORELLY":13400.00,"BIGHORN":11000.00,"SMITH":9000.00,"CHERRY":4500.00
}}
SELECT Bson_Array_Grp(NAME) FROM t3;
SELECT Bson_Array_Grp(NAME) FROM t3;
Bson_Array_Grp(NAME)
Bson_Array_Grp(NAME)
["BANCROFT","SMITH","MERCHANT","FUNNIGUY","BUGHAPPY","BIGHEAD","SHRINKY","WALTER","FODDERMAN","TONGHO","SHORTSIGHT","MESSIFUL","HONEY","GOOSEPEN","CHERRY","MONAPENNY","KITTY","PLUMHEAD","STRONG","BULLOZER","WERTHER","QUINN","ORELLY","BIGHORN","BROWNY","WHEELFOR","MARTIN"]
["BANCROFT","SMITH","MERCHANT","FUNNIGUY","BUGHAPPY","BIGHEAD","SHRINKY","WALTER","FODDERMAN","TONGHO","SHORTSIGHT","MESSIFUL","HONEY","GOOSEPEN","CHERRY","MONAPENNY","KITTY","PLUMHEAD","STRONG","BULLOZER","WERTHER","QUINN","ORELLY","BIGHORN","BROWNY","WHEELFOR","MARTIN"]
...
@@ -303,7 +303,7 @@ Bson_Object_Key(name, title)
...
@@ -303,7 +303,7 @@ Bson_Object_Key(name, title)
{"WHEELFOR":"SALESMAN"}
{"WHEELFOR":"SALESMAN"}
SELECT Bson_Object_Grp(name, title) FROM t3 WHERE DEPARTMENT = 318;
SELECT Bson_Object_Grp(name, title) FROM t3 WHERE DEPARTMENT = 318;
Bson_Object_Grp(name, title)
Bson_Object_Grp(name, title)
{"
SALESMAN":"WHEELFOR","ADMINISTRATOR":"SHRINKY","ENGINEER":"TONGHO","SECRETARY":"HONEY","TYPIST":"PLUMHEAD","DIRECTOR":"WERTHER
"}
{"
BANCROFT":"SALESMAN","MERCHANT":"SALESMAN","SHRINKY":"ADMINISTRATOR","WALTER":"ENGINEER","TONGHO":"ENGINEER","HONEY":"SECRETARY","PLUMHEAD":"TYPIST","WERTHER":"DIRECTOR","WHEELFOR":"SALESMAN
"}
#
#
# Test value getting UDF's
# Test value getting UDF's
#
#
...
...
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