Commit 9dfd9e5a authored by unknown's avatar unknown

Merge gweir@build.mysql.com:/home/bk/mysql-4.1

into greg-laptop.:C:/cygwin/bk/mysql-4.1

parents 4e44d808 ea023a30
...@@ -306,5 +306,5 @@ ...@@ -306,5 +306,5 @@
#define ER_WARN_DEPRECATED_SYNTAX 1287 #define ER_WARN_DEPRECATED_SYNTAX 1287
#define ER_NON_UPDATABLE_TABLE 1288 #define ER_NON_UPDATABLE_TABLE 1288
#define ER_FEATURE_DISABLED 1289 #define ER_FEATURE_DISABLED 1289
#define ER_SKIP_GRANT_TABLES 1290 #define ER_OPTION_PREVENTS_STATEMENT 1290
#define ER_ERROR_MESSAGES 291 #define ER_ERROR_MESSAGES 291
...@@ -64,8 +64,8 @@ static int FT_SUPERDOC_cmp(void* cmp_arg __attribute__((unused)), ...@@ -64,8 +64,8 @@ static int FT_SUPERDOC_cmp(void* cmp_arg __attribute__((unused)),
static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
{ {
int subkeys; int subkeys, r;
uint keylen, r, doc_cnt; uint keylen, doc_cnt;
FT_SUPERDOC sdoc, *sptr; FT_SUPERDOC sdoc, *sptr;
TREE_ELEMENT *selem; TREE_ELEMENT *selem;
double gweight=1; double gweight=1;
...@@ -73,7 +73,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) ...@@ -73,7 +73,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
uchar *keybuff=aio->keybuff; uchar *keybuff=aio->keybuff;
MI_KEYDEF *keyinfo=info->s->keyinfo+aio->keynr; MI_KEYDEF *keyinfo=info->s->keyinfo+aio->keynr;
my_off_t key_root=info->s->state.key_root[aio->keynr]; my_off_t key_root=info->s->state.key_root[aio->keynr];
uint extra=HA_FT_WLEN+info->s->base.rec_reflength+1; uint extra=HA_FT_WLEN+info->s->base.rec_reflength;
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT #if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
float tmp_weight; float tmp_weight;
#else #else
...@@ -96,10 +96,10 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) ...@@ -96,10 +96,10 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
if (keylen && if (keylen &&
mi_compare_text(aio->charset,info->lastkey+1, mi_compare_text(aio->charset,info->lastkey+1,
info->lastkey_length-extra, keybuff+1,keylen-1,0)) info->lastkey_length-extra-1, keybuff+1,keylen-1,0))
break; break;
subkeys=ft_sintXkorr(info->lastkey+keylen); subkeys=ft_sintXkorr(info->lastkey+info->lastkey_length-extra);
if (subkeys<0) if (subkeys<0)
{ {
if (doc_cnt) if (doc_cnt)
......
...@@ -346,6 +346,9 @@ t collation(t) ...@@ -346,6 +346,9 @@ t collation(t)
aus Osnabrck utf8_general_ci aus Osnabrck utf8_general_ci
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck'); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
t collation(t) t collation(t)
SELECT t, collation(t),MATCH t AGAINST ('Osnabruck') FROM t1 WHERE MATCH t AGAINST ('Osnabruck');
t collation(t) MATCH t AGAINST ('Osnabruck')
aus Osnabrck utf8_general_ci 1.591139793396
alter table t1 modify t varchar(200) collate latin1_german2_ci not null; alter table t1 modify t varchar(200) collate latin1_german2_ci not null;
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck'); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck');
t collation(t) t collation(t)
......
...@@ -65,6 +65,6 @@ NULL ...@@ -65,6 +65,6 @@ NULL
50000 50000
NULL NULL
Warnings: Warnings:
Error 1259 ZLIB: Input data was corrupted for zlib Error 1259 ZLIB: Input data corrupted
Error 1256 Too big size of uncompressed data. The maximum size is 1048576. (probably, length of uncompressed data was corrupted) Error 1256 Too big size of uncompressed data. The maximum size is 1048576. (probably, length of uncompressed data was corrupted)
drop table t1; drop table t1;
...@@ -44,9 +44,9 @@ create table t1 (a int, b char(10)); ...@@ -44,9 +44,9 @@ create table t1 (a int, b char(10));
load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
Warnings: Warnings:
Warning 1265 Data truncated for column 'a' at row 3 Warning 1265 Data truncated for column 'a' at row 3
Warning 1262 Row 3 was truncated; It contained more data than there where input columns Warning 1262 Row 3 was truncated; It contained more data than there were input columns
Warning 1265 Data truncated for column 'a' at row 5 Warning 1265 Data truncated for column 'a' at row 5
Warning 1262 Row 5 was truncated; It contained more data than there where input columns Warning 1262 Row 5 was truncated; It contained more data than there were input columns
select * from t1; select * from t1;
a b a b
1 row 1 1 row 1
......
...@@ -48,7 +48,7 @@ Warning 1265 Data truncated for column 'd' at row 3 ...@@ -48,7 +48,7 @@ Warning 1265 Data truncated for column 'd' at row 3
Warning 1265 Data truncated for column 'c' at row 4 Warning 1265 Data truncated for column 'c' at row 4
Warning 1261 Row 5 doesn't contain data for all columns Warning 1261 Row 5 doesn't contain data for all columns
Warning 1265 Data truncated for column 'b' at row 6 Warning 1265 Data truncated for column 'b' at row 6
Warning 1262 Row 7 was truncated; It contained more data than there where input columns Warning 1262 Row 7 was truncated; It contained more data than there were input columns
Warning 1264 Data truncated, out of range for column 'a' at row 8 Warning 1264 Data truncated, out of range for column 'a' at row 8
select @@warning_count; select @@warning_count;
@@warning_count @@warning_count
......
...@@ -268,6 +268,7 @@ SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabr ...@@ -268,6 +268,7 @@ SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabr
SET NAMES latin1; SET NAMES latin1;
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck'); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck');
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck'); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
SELECT t, collation(t),MATCH t AGAINST ('Osnabruck') FROM t1 WHERE MATCH t AGAINST ('Osnabruck');
#alter table t1 modify t text character set latin1 collate latin1_german2_ci not null; #alter table t1 modify t text character set latin1 collate latin1_german2_ci not null;
alter table t1 modify t varchar(200) collate latin1_german2_ci not null; alter table t1 modify t varchar(200) collate latin1_german2_ci not null;
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck'); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck');
......
...@@ -2554,7 +2554,7 @@ String *Item_func_compress::val_str(String *str) ...@@ -2554,7 +2554,7 @@ String *Item_func_compress::val_str(String *str)
size of the destination buffer, which must be at least 0.1% larger than size of the destination buffer, which must be at least 0.1% larger than
sourceLen plus 12 bytes. sourceLen plus 12 bytes.
Proportion 120/100 founded by Sinica with help of procedure Proportion 120/100 founded by Sinisa with help of procedure
compress(compress(compress(...))) compress(compress(compress(...)))
I.e. zlib give number 'at least'.. I.e. zlib give number 'at least'..
*/ */
......
...@@ -2951,8 +2951,6 @@ static void create_new_thread(THD *thd) ...@@ -2951,8 +2951,6 @@ static void create_new_thread(THD *thd)
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
pthread_mutex_lock(&LOCK_thread_count); pthread_mutex_lock(&LOCK_thread_count);
if (thread_count-delayed_insert_threads > max_used_connections)
max_used_connections=thread_count-delayed_insert_threads;
thd->thread_id=thread_id++; thd->thread_id=thread_id++;
thd->real_id=pthread_self(); // Keep purify happy thd->real_id=pthread_self(); // Keep purify happy
...@@ -2981,6 +2979,8 @@ static void create_new_thread(THD *thd) ...@@ -2981,6 +2979,8 @@ static void create_new_thread(THD *thd)
thread_count++; thread_count++;
thread_created++; thread_created++;
threads.append(thd); threads.append(thd);
if (thread_count-delayed_insert_threads > max_used_connections)
max_used_connections=thread_count-delayed_insert_threads;
DBUG_PRINT("info",(("creating thread %d"), thd->thread_id)); DBUG_PRINT("info",(("creating thread %d"), thd->thread_id));
thd->connect_time = time(NULL); thd->connect_time = time(NULL);
if ((error=pthread_create(&thd->real_id,&connection_attrib, if ((error=pthread_create(&thd->real_id,&connection_attrib,
......
...@@ -274,7 +274,7 @@ character-set=latin2 ...@@ -274,7 +274,7 @@ character-set=latin2
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -302,4 +302,4 @@ character-set=latin2 ...@@ -302,4 +302,4 @@ character-set=latin2
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updatable", "The target table %-.100s of the %s is not updatable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -268,7 +268,7 @@ character-set=latin1 ...@@ -268,7 +268,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -296,4 +296,4 @@ character-set=latin1 ...@@ -296,4 +296,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable", "The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -276,7 +276,7 @@ character-set=latin1 ...@@ -276,7 +276,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -304,4 +304,4 @@ character-set=latin1 ...@@ -304,4 +304,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable", "The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -260,12 +260,12 @@ character-set=latin1 ...@@ -260,12 +260,12 @@ character-set=latin1
"Slave is already running", "Slave is already running",
"Slave has already been stopped", "Slave has already been stopped",
"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", "Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)",
"ZLIB: Not enough memory available for zlib", "ZLIB: Not enough memory",
"ZLIB: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", "ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)",
"ZLIB: Input data was corrupted for zlib", "ZLIB: Input data corrupted",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -293,4 +293,4 @@ character-set=latin1 ...@@ -293,4 +293,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updatable", "The target table %-.100s of the %s is not updatable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -270,7 +270,7 @@ character-set=latin7 ...@@ -270,7 +270,7 @@ character-set=latin7
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -298,4 +298,4 @@ character-set=latin7 ...@@ -298,4 +298,4 @@ character-set=latin7
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable", "The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -265,7 +265,7 @@ character-set=latin1 ...@@ -265,7 +265,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -293,4 +293,4 @@ character-set=latin1 ...@@ -293,4 +293,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable", "The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -305,4 +305,4 @@ character-set=latin1 ...@@ -305,4 +305,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable", "The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -265,7 +265,7 @@ character-set=greek ...@@ -265,7 +265,7 @@ character-set=greek
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -293,4 +293,4 @@ character-set=greek ...@@ -293,4 +293,4 @@ character-set=greek
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable", "The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -267,7 +267,7 @@ character-set=latin2 ...@@ -267,7 +267,7 @@ character-set=latin2
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -295,4 +295,4 @@ character-set=latin2 ...@@ -295,4 +295,4 @@ character-set=latin2
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable", "The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -265,7 +265,7 @@ character-set=latin1 ...@@ -265,7 +265,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -293,4 +293,4 @@ character-set=latin1 ...@@ -293,4 +293,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable", "The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -267,7 +267,7 @@ character-set=ujis ...@@ -267,7 +267,7 @@ character-set=ujis
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -295,4 +295,4 @@ character-set=ujis ...@@ -295,4 +295,4 @@ character-set=ujis
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable", "The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -265,7 +265,7 @@ character-set=euckr ...@@ -265,7 +265,7 @@ character-set=euckr
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -293,4 +293,4 @@ character-set=euckr ...@@ -293,4 +293,4 @@ character-set=euckr
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable", "The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -267,7 +267,7 @@ character-set=latin1 ...@@ -267,7 +267,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -295,4 +295,4 @@ character-set=latin1 ...@@ -295,4 +295,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable", "The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -267,7 +267,7 @@ character-set=latin1 ...@@ -267,7 +267,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -295,4 +295,4 @@ character-set=latin1 ...@@ -295,4 +295,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable", "The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -269,7 +269,7 @@ character-set=latin2 ...@@ -269,7 +269,7 @@ character-set=latin2
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -295,6 +295,6 @@ character-set=latin2 ...@@ -295,6 +295,6 @@ character-set=latin2
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", "MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'", "Unknown table engine '%s'",
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateble", "The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -294,4 +294,4 @@ character-set=latin1 ...@@ -294,4 +294,4 @@ character-set=latin1
"'%s' é desatualizado. Use '%s' em seu lugar", "'%s' é desatualizado. Use '%s' em seu lugar",
"The target table %-.100s of the %s is not updateable", "The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -269,7 +269,7 @@ character-set=latin2 ...@@ -269,7 +269,7 @@ character-set=latin2
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -297,4 +297,4 @@ character-set=latin2 ...@@ -297,4 +297,4 @@ character-set=latin2
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable", "The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -267,7 +267,7 @@ character-set=koi8r ...@@ -267,7 +267,7 @@ character-set=koi8r
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -295,4 +295,4 @@ character-set=koi8r ...@@ -295,4 +295,4 @@ character-set=koi8r
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
" %-.100s %s ", " %-.100s %s ",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -259,7 +259,7 @@ character-set=cp1250 ...@@ -259,7 +259,7 @@ character-set=cp1250
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; it contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -287,4 +287,4 @@ character-set=cp1250 ...@@ -287,4 +287,4 @@ character-set=cp1250
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updatable", "The target table %-.100s of the %s is not updatable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working" "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working"
"MySQL is started in --skip-grant-tables mode. You can't use this command" "The MySQL server is running with the %s option so it cannot execute this statement"
...@@ -273,7 +273,7 @@ character-set=latin2 ...@@ -273,7 +273,7 @@ character-set=latin2
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -301,4 +301,4 @@ character-set=latin2 ...@@ -301,4 +301,4 @@ character-set=latin2
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable", "The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -267,7 +267,7 @@ character-set=latin1 ...@@ -267,7 +267,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -295,4 +295,4 @@ character-set=latin1 ...@@ -295,4 +295,4 @@ character-set=latin1
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updateable", "The target table %-.100s of the %s is not updateable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -265,7 +265,7 @@ character-set=latin1 ...@@ -265,7 +265,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d rad(er) kapades av group_concat()", "%d rad(er) kapades av group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
......
...@@ -270,7 +270,7 @@ character-set=koi8u ...@@ -270,7 +270,7 @@ character-set=koi8u
"Z_DATA_ERROR: Input data was corrupted for zlib", "Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()", "%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns", "Row %ld doesn't contain data for all columns",
"Row %ld was truncated; It contained more data than there where input columns", "Row %ld was truncated; It contained more data than there were input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", "Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld", "Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld", "Data truncated for column '%s' at row %ld",
...@@ -298,4 +298,4 @@ character-set=koi8u ...@@ -298,4 +298,4 @@ character-set=koi8u
"'%s' is deprecated, use '%s' instead", "'%s' is deprecated, use '%s' instead",
" %-.100s %s ", " %-.100s %s ",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working", "The '%s' feature was disabled; you need MySQL built with '%s' define to have it working",
"MySQL is started in --skip-grant-tables mode. You can't use this command", "The MySQL server is running with the %s option so it cannot execute this statement",
...@@ -1115,7 +1115,8 @@ bool check_change_password(THD *thd, const char *host, const char *user) ...@@ -1115,7 +1115,8 @@ bool check_change_password(THD *thd, const char *host, const char *user)
{ {
if (!initialized) if (!initialized)
{ {
send_error(thd, ER_SKIP_GRANT_TABLES); /* purecov: inspected */ net_printf(thd,ER_OPTION_PREVENTS_STATEMENT,
"--skip-grant-tables"); /* purecov: inspected */
return(1); /* purecov: inspected */ return(1); /* purecov: inspected */
} }
if (!thd->slave_thread && if (!thd->slave_thread &&
...@@ -1433,13 +1434,10 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, ...@@ -1433,13 +1434,10 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
if (!create_user) if (!create_user)
{ {
if (what == 'N') if (what == 'N')
my_printf_error(ER_NONEXISTING_GRANT,ER(ER_NONEXISTING_GRANT), my_error(ER_NONEXISTING_GRANT, MYF(0), combo.user.str, combo.host.str);
MYF(0),combo.user.str,combo.host.str);
else else
my_printf_error(ER_NO_PERMISSION_TO_CREATE_USER, my_error(ER_NO_PERMISSION_TO_CREATE_USER, MYF(0),
ER(ER_NO_PERMISSION_TO_CREATE_USER), thd->user, thd->host_or_ip);
MYF(0),thd->user,
thd->host_or_ip);
error= -1; error= -1;
goto end; goto end;
} }
...@@ -1593,7 +1591,7 @@ static int replace_db_table(TABLE *table, const char *db, ...@@ -1593,7 +1591,7 @@ static int replace_db_table(TABLE *table, const char *db,
if (!initialized) if (!initialized)
{ {
my_error(ER_SKIP_GRANT_TABLES, MYF(0)); my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables");
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
...@@ -1613,8 +1611,7 @@ static int replace_db_table(TABLE *table, const char *db, ...@@ -1613,8 +1611,7 @@ static int replace_db_table(TABLE *table, const char *db,
{ {
if (what == 'N') if (what == 'N')
{ // no row, no revoke { // no row, no revoke
my_printf_error(ER_NONEXISTING_GRANT,ER(ER_NONEXISTING_GRANT),MYF(0), my_error(ER_NONEXISTING_GRANT, MYF(0), combo.user.str, combo.host.str);
combo.user.str,combo.host.str);
goto abort; goto abort;
} }
old_row_exists = 0; old_row_exists = 0;
...@@ -1903,9 +1900,8 @@ static int replace_column_table(GRANT_TABLE *g_t, ...@@ -1903,9 +1900,8 @@ static int replace_column_table(GRANT_TABLE *g_t,
{ {
if (revoke_grant) if (revoke_grant)
{ {
my_printf_error(ER_NONEXISTING_TABLE_GRANT, my_error(ER_NONEXISTING_TABLE_GRANT, MYF(0),
ER(ER_NONEXISTING_TABLE_GRANT),MYF(0), combo.user.str, combo.host.str, table_name); /* purecov: inspected */
combo.user.str, combo.host.str,table_name); /* purecov: inspected */
result= -1; /* purecov: inspected */ result= -1; /* purecov: inspected */
continue; /* purecov: inspected */ continue; /* purecov: inspected */
} }
...@@ -2071,10 +2067,9 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table, ...@@ -2071,10 +2067,9 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
*/ */
if (revoke_grant) if (revoke_grant)
{ // no row, no revoke { // no row, no revoke
my_printf_error(ER_NONEXISTING_TABLE_GRANT, my_error(ER_NONEXISTING_TABLE_GRANT, MYF(0),
ER(ER_NONEXISTING_TABLE_GRANT),MYF(0), combo.user.str, combo.host.str,
combo.user.str,combo.host.str, table_name); /* purecov: deadcode */
table_name); /* purecov: deadcode */
DBUG_RETURN(-1); /* purecov: deadcode */ DBUG_RETURN(-1); /* purecov: deadcode */
} }
old_row_exists = 0; old_row_exists = 0;
...@@ -2174,8 +2169,9 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, ...@@ -2174,8 +2169,9 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
if (!initialized) if (!initialized)
{ {
send_error(thd, ER_SKIP_GRANT_TABLES); /* purecov: inspected */ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0),
DBUG_RETURN(1); /* purecov: inspected */ "--skip-grant-tables"); /* purecov: inspected */
DBUG_RETURN(-1); /* purecov: inspected */
} }
if (rights & ~TABLE_ACLS) if (rights & ~TABLE_ACLS)
{ {
...@@ -2196,8 +2192,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, ...@@ -2196,8 +2192,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
if (!find_field_in_table(thd,table,column->column.ptr(), if (!find_field_in_table(thd,table,column->column.ptr(),
column->column.length(),0,0)) column->column.length(),0,0))
{ {
my_printf_error(ER_BAD_FIELD_ERROR,ER(ER_BAD_FIELD_ERROR),MYF(0), my_error(ER_BAD_FIELD_ERROR, MYF(0),
column->column.c_ptr(), table_list->alias); column->column.c_ptr(), table_list->alias);
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
column_priv|= column->rights; column_priv|= column->rights;
...@@ -2212,7 +2208,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, ...@@ -2212,7 +2208,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
fn_format(buf,buf,"","",4+16+32); fn_format(buf,buf,"","",4+16+32);
if (access(buf,F_OK)) if (access(buf,F_OK))
{ {
my_error(ER_NO_SUCH_TABLE,MYF(0),table_list->db, table_list->alias); my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->db, table_list->alias);
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
} }
...@@ -2291,9 +2287,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, ...@@ -2291,9 +2287,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
{ {
if (revoke_grant) if (revoke_grant)
{ {
my_printf_error(ER_NONEXISTING_TABLE_GRANT, my_error(ER_NONEXISTING_TABLE_GRANT, MYF(0),
ER(ER_NONEXISTING_TABLE_GRANT),MYF(0), Str->user.str, Str->host.str, table_list->real_name);
Str->user.str, Str->host.str, table_list->real_name);
result= -1; result= -1;
continue; continue;
} }
...@@ -2384,7 +2379,8 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list, ...@@ -2384,7 +2379,8 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
DBUG_ENTER("mysql_grant"); DBUG_ENTER("mysql_grant");
if (!initialized) if (!initialized)
{ {
my_error(ER_SKIP_GRANT_TABLES, MYF(0)); /* purecov: tested */ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0),
"--skip-grant-tables"); /* purecov: tested */
DBUG_RETURN(-1); /* purecov: tested */ DBUG_RETURN(-1); /* purecov: tested */
} }
...@@ -2463,8 +2459,7 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list, ...@@ -2463,8 +2459,7 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
} }
else else
{ {
my_printf_error(ER_WRONG_USAGE, ER(ER_WRONG_USAGE), MYF(0), my_error(ER_WRONG_USAGE, MYF(0), "DB GRANT", "GLOBAL PRIVILEGES");
"DB GRANT","GLOBAL PRIVILEGES");
result= -1; result= -1;
} }
} }
...@@ -2990,8 +2985,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) ...@@ -2990,8 +2985,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
LINT_INIT(acl_user); LINT_INIT(acl_user);
if (!initialized) if (!initialized)
{ {
send_error(thd, ER_SKIP_GRANT_TABLES); my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables");
DBUG_RETURN(1); DBUG_RETURN(-1);
} }
if (lex_user->host.length > HOSTNAME_LENGTH || if (lex_user->host.length > HOSTNAME_LENGTH ||
lex_user->user.length > USERNAME_LENGTH) lex_user->user.length > USERNAME_LENGTH)
...@@ -3014,8 +3009,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) ...@@ -3014,8 +3009,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
} }
if (counter == acl_users.elements) if (counter == acl_users.elements)
{ {
my_printf_error(ER_NONEXISTING_GRANT,ER(ER_NONEXISTING_GRANT), my_error(ER_NONEXISTING_GRANT, MYF(0),
MYF(0),lex_user->user.str,lex_user->host.str); lex_user->user.str, lex_user->host.str);
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
...@@ -3343,7 +3338,7 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables) ...@@ -3343,7 +3338,7 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables)
if (!initialized) if (!initialized)
{ {
send_error(thd, ER_SKIP_GRANT_TABLES); net_printf(thd,ER_OPTION_PREVENTS_STATEMENT, "--skip-grant-tables");
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
......
...@@ -528,7 +528,7 @@ class Statement ...@@ -528,7 +528,7 @@ class Statement
void set_n_backup_item_arena(Statement *set, Statement *backup); void set_n_backup_item_arena(Statement *set, Statement *backup);
void restore_backup_item_arena(Statement *set, Statement *backup); void restore_backup_item_arena(Statement *set, Statement *backup);
void Statement::set_item_arena(Statement *set); void set_item_arena(Statement *set);
}; };
......
...@@ -1835,7 +1835,7 @@ mysql_execute_command(THD *thd) ...@@ -1835,7 +1835,7 @@ mysql_execute_command(THD *thd)
!(thd->slave_thread || (thd->master_access & SUPER_ACL)) && !(thd->slave_thread || (thd->master_access & SUPER_ACL)) &&
(uc_update_queries[lex->sql_command] > 0)) (uc_update_queries[lex->sql_command] > 0))
{ {
send_error(thd, ER_CANT_UPDATE_WITH_READLOCK); net_printf(thd, ER_OPTION_PREVENTS_STATEMENT, "--read-only");
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
...@@ -3053,6 +3053,22 @@ mysql_execute_command(THD *thd) ...@@ -3053,6 +3053,22 @@ mysql_execute_command(THD *thd)
net_printf(thd, ER_WRONG_DB_NAME, lex->name); net_printf(thd, ER_WRONG_DB_NAME, lex->name);
break; break;
} }
/*
If in a slave thread :
ALTER DATABASE DB may not be preceded by USE DB.
For that reason, maybe db_ok() in sql/slave.cc did not check the
do_db/ignore_db. And as this query involves no tables, tables_ok()
above was not called. So we have to check rules again here.
*/
#ifdef HAVE_REPLICATION
if (thd->slave_thread &&
(!db_ok(lex->name, replicate_do_db, replicate_ignore_db) ||
!db_ok_with_wild_table(lex->name)))
{
my_error(ER_SLAVE_IGNORED_TABLE, MYF(0));
break;
}
#endif
if (check_access(thd,ALTER_ACL,lex->name,0,1,0)) if (check_access(thd,ALTER_ACL,lex->name,0,1,0))
break; break;
if (thd->locked_tables || thd->active_transaction()) if (thd->locked_tables || thd->active_transaction())
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
/*************************************************************************** /***************************************************************************
This is a test sample to test the new features in MySQL client-server This is a test sample to test the new features in MySQL client-server
protocol protocol
Main author: venu ( venu@mysql.com ) Main author: venu ( venu@mysql.com )
...@@ -6553,7 +6553,7 @@ static void test_decimal_bug() ...@@ -6553,7 +6553,7 @@ static void test_decimal_bug()
{ {
MYSQL_STMT *stmt; MYSQL_STMT *stmt;
MYSQL_BIND bind[1]; MYSQL_BIND bind[1];
double data; char data[30];
int rc; int rc;
my_bool is_null; my_bool is_null;
...@@ -6573,9 +6573,9 @@ static void test_decimal_bug() ...@@ -6573,9 +6573,9 @@ static void test_decimal_bug()
stmt = mysql_simple_prepare(mysql,"select c1 from test_decimal_bug where c1= ?"); stmt = mysql_simple_prepare(mysql,"select c1 from test_decimal_bug where c1= ?");
mystmt_init(stmt); mystmt_init(stmt);
bind[0].buffer_type= MYSQL_TYPE_DOUBLE; bind[0].buffer_type= MYSQL_TYPE_STRING;
bind[0].buffer= (char *)&data; bind[0].buffer= (char *)data;
bind[0].buffer_length= 0; bind[0].buffer_length= 25;
bind[0].is_null= &is_null; bind[0].is_null= &is_null;
bind[0].length= 0; bind[0].length= 0;
...@@ -6583,36 +6583,36 @@ static void test_decimal_bug() ...@@ -6583,36 +6583,36 @@ static void test_decimal_bug()
rc = mysql_bind_param(stmt, bind); rc = mysql_bind_param(stmt, bind);
mystmt(stmt,rc); mystmt(stmt,rc);
data= 8.0; strcpy(data, "8.0");
rc = mysql_execute(stmt); rc = mysql_execute(stmt);
mystmt(stmt,rc); mystmt(stmt,rc);
data=0; data[0]=0;
rc = mysql_bind_result(stmt, bind); rc = mysql_bind_result(stmt, bind);
mystmt(stmt,rc); mystmt(stmt,rc);
rc = mysql_fetch(stmt); rc = mysql_fetch(stmt);
mystmt(stmt,rc); mystmt(stmt,rc);
fprintf(stdout, "\n data: %g", data); fprintf(stdout, "\n data: %s", data);
assert(data == 8.0); assert(strcmp(data, "8.00")==0);
rc = mysql_fetch(stmt); rc = mysql_fetch(stmt);
assert(rc == MYSQL_NO_DATA); assert(rc == MYSQL_NO_DATA);
data= 5.61; strcpy(data, "5.61");
rc = mysql_execute(stmt); rc = mysql_execute(stmt);
mystmt(stmt,rc); mystmt(stmt,rc);
data=0; data[0]=0;
rc = mysql_bind_result(stmt, bind); rc = mysql_bind_result(stmt, bind);
mystmt(stmt,rc); mystmt(stmt,rc);
rc = mysql_fetch(stmt); rc = mysql_fetch(stmt);
mystmt(stmt,rc); mystmt(stmt,rc);
fprintf(stdout, "\n data: %g", data); fprintf(stdout, "\n data: %s", data);
assert(data == 5.61); assert(strcmp(data, "5.61")==0);
rc = mysql_fetch(stmt); rc = mysql_fetch(stmt);
assert(rc == MYSQL_NO_DATA); assert(rc == MYSQL_NO_DATA);
...@@ -6624,19 +6624,19 @@ static void test_decimal_bug() ...@@ -6624,19 +6624,19 @@ static void test_decimal_bug()
rc = mysql_fetch(stmt); rc = mysql_fetch(stmt);
assert(rc == MYSQL_NO_DATA); assert(rc == MYSQL_NO_DATA);
data= 10.22; is_null= 0; strcpy(data, "10.22"); is_null= 0;
rc = mysql_execute(stmt); rc = mysql_execute(stmt);
mystmt(stmt,rc); mystmt(stmt,rc);
data=0; data[0]=0;
rc = mysql_bind_result(stmt, bind); rc = mysql_bind_result(stmt, bind);
mystmt(stmt,rc); mystmt(stmt,rc);
rc = mysql_fetch(stmt); rc = mysql_fetch(stmt);
mystmt(stmt,rc); mystmt(stmt,rc);
fprintf(stdout, "\n data: %g", data); fprintf(stdout, "\n data: %s", data);
assert(data == 10.22); assert(strcmp(data, "10.22")==0);
rc = mysql_fetch(stmt); rc = mysql_fetch(stmt);
assert(rc == MYSQL_NO_DATA); assert(rc == MYSQL_NO_DATA);
...@@ -8256,7 +8256,7 @@ static void test_distinct() ...@@ -8256,7 +8256,7 @@ static void test_distinct()
rc= mysql_query(mysql, rc= mysql_query(mysql,
"insert into t1 values (1,1), (2, 2), (3,3), (4,4), (5,5),\ "insert into t1 values (1,1), (2, 2), (3,3), (4,4), (5,5),\
(1,10), (2, 20), (3,30), (4,40), (5,50)\;"); (1,10), (2, 20), (3,30), (4,40), (5,50);");
myquery(rc); myquery(rc);
for (i= 0; i < 3; i++) for (i= 0; i < 3; i++)
......
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