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

This commit is contained in:
msvensson@neptunus.(none) 2006-03-07 07:50:04 +01:00
parent f063ce8e31
commit 456b2d6b14
2 changed files with 7 additions and 7 deletions

View File

@ -1360,9 +1360,9 @@ int do_modify_var(struct st_query *query,
const char *p= query->first_argument;
VAR* v;
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 != '$')
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);
v= var_get(p, &p, 1, 0);
switch (operator) {
@ -1373,7 +1373,7 @@ int do_modify_var(struct st_query *query,
v->int_val++;
break;
default:
die("Invalid operator to do_operator");
die("Invalid operator to do_modify_var");
break;
}
v->int_dirty= 1;

View File

@ -305,8 +305,8 @@ mysqltest: At line 1: Invalid argument to real_sleep "abc"
101
hej
1
mysqltest: At line 1: Missing arguments to inc
mysqltest: At line 1: First argument to inc must be a variable (start with $)
mysqltest: At line 1: Missing argument to inc
mysqltest: At line 1: The argument to inc must be a variable (start with $)
mysqltest: At line 1: End of line junk detected: "1000"
4
4
@ -315,8 +315,8 @@ mysqltest: At line 1: End of line junk detected: "1000"
99
hej
-1
mysqltest: At line 1: Missing arguments to dec
mysqltest: At line 1: First argument to dec must be a variable (start with $)
mysqltest: At line 1: Missing argument to dec
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: Missing arguments to system, nothing to do!
mysqltest: At line 1: Missing arguments to system, nothing to do!