diff options
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index f637c14d1c4..e38e1e4919a 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4283,6 +4283,21 @@ longlong Item_func_get_lock::val_int() DBUG_RETURN(1); } + if (args[1]->null_value || + (!args[1]->unsigned_flag && ((longlong) timeout < 0))) + { + char buf[22]; + if (args[1]->null_value) + strmov(buf, "NULL"); + else + llstr(((longlong) timeout), buf); + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_WRONG_VALUE_FOR_TYPE, ER(ER_WRONG_VALUE_FOR_TYPE), + "timeout", buf, "get_lock"); + null_value= 1; + DBUG_RETURN(0); + } + if (!ull_name_ok(res)) DBUG_RETURN(0); DBUG_PRINT("enter", ("lock: %.*s", res->length(), res->ptr())); |