Commit a9d32010 authored by Olivier Bertrand's avatar Olivier Bertrand

- Fix MDEV-13239 Suppress the restriction about no blanks

around , and = in the OPTION_LIST.
  modified:   storage/connect/ha_connect.cc
parent 7542aff6
......@@ -1036,25 +1036,42 @@ PCSZ GetListOption(PGLOBAL g, PCSZ opname, PCSZ oplist, PCSZ def)
return (char*)def;
char key[16], val[256];
char *pk, *pv, *pn;
char *pv, *pn, *pk= (char*)oplist;
PCSZ opval= def;
int n;
for (pk= (char*)oplist; pk; pk= ++pn) {
while (*pk == ' ')
pk++;
for (; pk; pk= pn) {
pn= strchr(pk, ',');
pv= strchr(pk, '=');
if (pv && (!pn || pv < pn)) {
n = MY_MIN(static_cast<size_t>(pv - pk), sizeof(key) - 1);
memcpy(key, pk, n);
while (n && key[n - 1] == ' ')
n--;
key[n]= 0;
pv++;
while(*(++pv) == ' ') ;
n= MY_MIN((pn ? pn - pv : strlen(pv)), sizeof(val) - 1);
memcpy(val, pv, n);
while (n && val[n - 1] == ' ')
n--;
val[n]= 0;
} else {
n= MY_MIN((pn ? pn - pk : strlen(pk)), sizeof(key) - 1);
memcpy(key, pk, n);
while (n && key[n - 1] == ' ')
n--;
key[n]= 0;
val[0]= 0;
} // endif pv
......@@ -1065,6 +1082,7 @@ PCSZ GetListOption(PGLOBAL g, PCSZ opname, PCSZ oplist, PCSZ def)
} else if (!pn)
break;
while (*(++pn) == ' ') ;
} // endfor pk
return opval;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment