Improve error message for faulty usage of "inc" and "dec"

parent f063ce8e
...@@ -1360,9 +1360,9 @@ int do_modify_var(struct st_query *query, ...@@ -1360,9 +1360,9 @@ int do_modify_var(struct st_query *query,
const char *p= query->first_argument; const char *p= query->first_argument;
VAR* v; VAR* v;
if (!*p) if (!*p)
die("Missing arguments to %.*s", query->first_word_len, query->query); die("Missing argument to %.*s", query->first_word_len, query->query);
if (*p != '$') if (*p != '$')
die("First argument to %.*s must be a variable (start with $)", die("The argument to %.*s must be a variable (start with $)",
query->first_word_len, query->query); query->first_word_len, query->query);
v= var_get(p, &p, 1, 0); v= var_get(p, &p, 1, 0);
switch (operator) { switch (operator) {
...@@ -1373,7 +1373,7 @@ int do_modify_var(struct st_query *query, ...@@ -1373,7 +1373,7 @@ int do_modify_var(struct st_query *query,
v->int_val++; v->int_val++;
break; break;
default: default:
die("Invalid operator to do_operator"); die("Invalid operator to do_modify_var");
break; break;
} }
v->int_dirty= 1; v->int_dirty= 1;
......
...@@ -305,8 +305,8 @@ mysqltest: At line 1: Invalid argument to real_sleep "abc" ...@@ -305,8 +305,8 @@ mysqltest: At line 1: Invalid argument to real_sleep "abc"
101 101
hej hej
1 1
mysqltest: At line 1: Missing arguments to inc mysqltest: At line 1: Missing argument to inc
mysqltest: At line 1: First argument to inc must be a variable (start with $) mysqltest: At line 1: The argument to inc must be a variable (start with $)
mysqltest: At line 1: End of line junk detected: "1000" mysqltest: At line 1: End of line junk detected: "1000"
4 4
4 4
...@@ -315,8 +315,8 @@ mysqltest: At line 1: End of line junk detected: "1000" ...@@ -315,8 +315,8 @@ mysqltest: At line 1: End of line junk detected: "1000"
99 99
hej hej
-1 -1
mysqltest: At line 1: Missing arguments to dec mysqltest: At line 1: Missing argument to dec
mysqltest: At line 1: First argument to dec must be a variable (start with $) mysqltest: At line 1: The argument to dec must be a variable (start with $)
mysqltest: At line 1: End of line junk detected: "1000" mysqltest: At line 1: End of line junk detected: "1000"
mysqltest: At line 1: Missing arguments to system, nothing to do! mysqltest: At line 1: Missing arguments to system, nothing to do!
mysqltest: At line 1: Missing arguments to system, nothing to do! mysqltest: At line 1: Missing arguments to system, nothing to do!
......
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