1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-14012 - sql_mode=Oracle: substr(): treat position 0 as position 1

This commit is contained in:
halfspawn
2017-10-06 09:23:06 +02:00
parent 3e39771551
commit 34f36a335b
9 changed files with 174 additions and 20 deletions

View File

@ -7182,6 +7182,22 @@ bool LEX::add_grant_command(THD *thd, enum_sql_command sql_command_arg,
}
Item *LEX::make_item_func_substr(THD *thd, Item *a, Item *b, Item *c)
{
return (thd->variables.sql_mode & MODE_ORACLE) ?
new (thd->mem_root) Item_func_substr_oracle(thd, a, b, c) :
new (thd->mem_root) Item_func_substr(thd, a, b, c);
}
Item *LEX::make_item_func_substr(THD *thd, Item *a, Item *b)
{
return (thd->variables.sql_mode & MODE_ORACLE) ?
new (thd->mem_root) Item_func_substr_oracle(thd, a, b) :
new (thd->mem_root) Item_func_substr(thd, a, b);
}
Item *LEX::make_item_func_replace(THD *thd,
Item *org,
Item *find,