This commit is contained in:
VilhoRaatikka
2014-09-01 13:57:31 +03:00
parent 20abbbdf57
commit 3c1abf4b64

View File

@ -918,35 +918,34 @@ char* skygw_get_canonical(
{ {
Item::Type itype; Item::Type itype;
itype = item->type(); if (item->name == NULL)
{
if (item->name != NULL && continue;
(itype == Item::STRING_ITEM || }
itype == Item::INT_ITEM || itype = item->type();
itype == Item::DECIMAL_ITEM ||
itype == Item::REAL_ITEM ||
itype == Item::VARBIN_ITEM ||
itype == Item::NULL_ITEM))
{
if (itype == Item::STRING_ITEM)
{
String tokenstr;
String* res = item->val_str_ascii(&tokenstr);
if (res->is_empty()) /*< empty string */ if (itype == Item::STRING_ITEM)
{ {
querystr = replace_literal(querystr, "\"\"", "\"?\""); String tokenstr;
} String* res = item->val_str_ascii(&tokenstr);
else
{ if (res->is_empty()) /*< empty string */
querystr = replace_literal(querystr, res->ptr(), "?"); {
} querystr = replace_literal(querystr, "\"\"", "\"?\"");
} }
else else
{ {
querystr = replace_literal(querystr, item->name, "?"); querystr = replace_literal(querystr, res->ptr(), "?");
} }
} }
else if (itype == Item::INT_ITEM ||
itype == Item::DECIMAL_ITEM ||
itype == Item::REAL_ITEM ||
itype == Item::VARBIN_ITEM ||
itype == Item::NULL_ITEM)
{
querystr = replace_literal(querystr, item->name, "?");
}
} /*< for */ } /*< for */
retblock: retblock:
return querystr; return querystr;