mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-36894 JSNX::SetArrayOptions and BJNX::SetArrayOptions unused nm arg
Calling SetArrayOptions with Nodes[i - 1].Key as its nm argument exposed a MemorySanitizer error when i=0 for the tests: * connect.bson_udf * connect.json_udf * connect.json_udf_bin Its assumed that a basic optimization would have eliminated these invalid expressions. As the nm argument was unused, it has been removed.
This commit is contained in:
@@ -191,7 +191,7 @@ my_bool BJNX::SetJpath(PGLOBAL g, char* path, my_bool jb)
|
|||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
/* Analyse array processing options. */
|
/* Analyse array processing options. */
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
my_bool BJNX::SetArrayOptions(PGLOBAL g, char* p, int i, PSZ nm)
|
my_bool BJNX::SetArrayOptions(PGLOBAL g, char* p, int i)
|
||||||
{
|
{
|
||||||
int n = (int)strlen(p);
|
int n = (int)strlen(p);
|
||||||
my_bool dg = true, b = false;
|
my_bool dg = true, b = false;
|
||||||
@@ -339,7 +339,7 @@ my_bool BJNX::ParseJpath(PGLOBAL g)
|
|||||||
// Jpath must be explicit
|
// Jpath must be explicit
|
||||||
if (a || *p == 0 || *p == '[' || IsNum(p)) {
|
if (a || *p == 0 || *p == '[' || IsNum(p)) {
|
||||||
// Analyse intermediate array processing
|
// Analyse intermediate array processing
|
||||||
if (SetArrayOptions(g, p, i, Nodes[i - 1].Key))
|
if (SetArrayOptions(g, p, i))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else if (*p == '*') {
|
} else if (*p == '*') {
|
||||||
|
@@ -116,7 +116,7 @@ public:
|
|||||||
PBSON MakeBinResult(UDF_ARGS* args, PBVAL top, ulong len, int n = 2);
|
PBSON MakeBinResult(UDF_ARGS* args, PBVAL top, ulong len, int n = 2);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
my_bool SetArrayOptions(PGLOBAL g, char* p, int i, PSZ nm);
|
my_bool SetArrayOptions(PGLOBAL g, char* p, int i);
|
||||||
PVAL GetColumnValue(PGLOBAL g, PBVAL row, int i);
|
PVAL GetColumnValue(PGLOBAL g, PBVAL row, int i);
|
||||||
PVAL ExpandArray(PGLOBAL g, PBVAL arp, int n);
|
PVAL ExpandArray(PGLOBAL g, PBVAL arp, int n);
|
||||||
PVAL CalculateArray(PGLOBAL g, PBVAL arp, int n);
|
PVAL CalculateArray(PGLOBAL g, PBVAL arp, int n);
|
||||||
|
@@ -112,7 +112,7 @@ my_bool JSNX::SetJpath(PGLOBAL g, char *path, my_bool jb)
|
|||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
/* Analyse array processing options. */
|
/* Analyse array processing options. */
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
my_bool JSNX::SetArrayOptions(PGLOBAL g, char *p, int i, PSZ nm)
|
my_bool JSNX::SetArrayOptions(PGLOBAL g, char *p, int i)
|
||||||
{
|
{
|
||||||
int n = (int)strlen(p);
|
int n = (int)strlen(p);
|
||||||
my_bool dg = true, b = false;
|
my_bool dg = true, b = false;
|
||||||
@@ -262,7 +262,7 @@ my_bool JSNX::ParseJpath(PGLOBAL g)
|
|||||||
// Jpath must be explicit
|
// Jpath must be explicit
|
||||||
if (a || *p == 0 || *p == '[' || IsNum(p)) {
|
if (a || *p == 0 || *p == '[' || IsNum(p)) {
|
||||||
// Analyse intermediate array processing
|
// Analyse intermediate array processing
|
||||||
if (SetArrayOptions(g, p, i, Nodes[i-1].Key))
|
if (SetArrayOptions(g, p, i))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else if (*p == '*') {
|
} else if (*p == '*') {
|
||||||
|
@@ -330,7 +330,7 @@ public:
|
|||||||
char *LocateAll(PGLOBAL g, PJSON jsp, PJVAL jvp, int mx = 10);
|
char *LocateAll(PGLOBAL g, PJSON jsp, PJVAL jvp, int mx = 10);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
my_bool SetArrayOptions(PGLOBAL g, char *p, int i, PSZ nm);
|
my_bool SetArrayOptions(PGLOBAL g, char *p, int i);
|
||||||
PVAL GetColumnValue(PGLOBAL g, PJSON row, int i);
|
PVAL GetColumnValue(PGLOBAL g, PJSON row, int i);
|
||||||
PVAL ExpandArray(PGLOBAL g, PJAR arp, int n);
|
PVAL ExpandArray(PGLOBAL g, PJAR arp, int n);
|
||||||
PVAL GetCalcValue(PGLOBAL g, PJAR bap, int n);
|
PVAL GetCalcValue(PGLOBAL g, PJAR bap, int n);
|
||||||
|
Reference in New Issue
Block a user