Loading Docs/manual.texi +9 −1 Original line number Diff line number Diff line Loading @@ -35586,6 +35586,10 @@ In addition, a query may be seen as different if for instance one client is using a new communication protocol format or another character set than another client. Queries that uses different databases, uses different protocol versions or the uses different default character sets are considered different queries and cached separately. The cache does work for @code{SELECT CALC_ROWS ...} and @code{SELECT FOUND_ROWS() ...} type queries because the number of found rows is also stored in the cache. Loading Loading @@ -35624,8 +35628,12 @@ of the form @code{SELECT * FROM AUTOINCREMENT_FIELD IS NULL} However, @code{FOUND ROWS()} will return the correct value, even if the preceding query was fetched from the cache. Queries that don't use any tables are not cached. Queries that don't use any tables or if the user has a column privilege for any of the involved tables are not cached. Before a query is fetched from the query cache, MySQL will check that the user has SELECT privilege to all the involved databases and tables. If this is not the case, the cached result will not be used. @node Query Cache Configuration, Query Cache in SELECT, Query Cache How, Query Cache @subsection Query Cache Configuration client/mysqltest.c +6 −3 Original line number Diff line number Diff line Loading @@ -1248,7 +1248,8 @@ int close_connection(struct st_query* q) } /* this one now is a hack - we may want to improve in in the /* This one now is a hack - we may want to improve in in the future to handle quotes. For now we assume that anything that is not a comma, a space or ) belongs to the argument. space is a chopper, comma or ) are delimiters/terminators Loading Loading @@ -1291,8 +1292,7 @@ int safe_connect(MYSQL* con, const char* host, const char* user, int i; for (i = 0; i < MAX_CON_TRIES; ++i) { if(mysql_real_connect(con, host,user, pass, db, port, sock, 0)) if (mysql_real_connect(con, host,user, pass, db, port, sock, 0)) { con_error = 0; break; Loading Loading @@ -1365,6 +1365,9 @@ int do_connect(struct st_query* q) con_sock=fn_format(buff, con_sock, TMPDIR, "",0); if (!con_db[0]) con_db=db; /* Special database to allow one to connect without a database name */ if (!strcmp(con_db,"*NO-ONE*")) con_db=0; if ((con_error = safe_connect(&next_con->mysql, con_host, con_user, con_pass, con_db, con_port, con_sock ? con_sock: 0))) Loading include/raid.h +3 −1 Original line number Diff line number Diff line Loading @@ -22,8 +22,10 @@ #define RAID_DEFAULT_CHUNKS 4 #define RAID_DEFAULT_CHUNKSIZE 256*1024 /* 256kB */ extern const char *raid_type_string[]; C_MODE_START #define my_raid_type(raid_type) raid_type_string[(int)(raid_type)] extern const char *raid_type_string[]; C_MODE_END #if defined(USE_RAID) && !defined(DONT_USE_RAID) Loading mysql-test/r/drop.result +18 −18 Original line number Diff line number Diff line Loading @@ -12,37 +12,37 @@ drop table t1; select * from t1; n 1 drop database if exists foo; create database foo; drop database if exists foo; create database foo; create table foo.foo (n int); insert into foo.foo values (4); select * from foo.foo; drop database if exists mysqltest; create database mysqltest; drop database if exists mysqltest; create database mysqltest; create table mysqltest.mysqltest (n int); insert into mysqltest.mysqltest values (4); select * from mysqltest.mysqltest; n 4 drop database if exists foo; create database foo; drop database foo; drop database if exists foo; drop database if exists mysqltest; create database mysqltest; drop database mysqltest; drop database if exists mysqltest; flush tables with read lock; create database foo; create database mysqltest; Got one of the listed errors unlock tables; create database foo; create database mysqltest; show databases; Database foo mysql mysqltest test flush tables with read lock; drop database foo; drop database mysqltest; Got one of the listed errors unlock tables; drop database foo; drop database mysqltest; show databases; Database mysql test drop database foo; Can't drop database 'foo'. Database doesn't exist drop database mysqltest; Can't drop database 'mysqltest'. Database doesn't exist mysql-test/r/flush.result +6 −6 Original line number Diff line number Diff line Loading @@ -11,13 +11,13 @@ drop table t2; Table 't2' was locked with a READ lock and can't be updated drop table t2; unlock tables; drop database if exists foo; create database foo; create table foo.t1(n int); insert into foo.t1 values (23); drop database if exists mysqltest; create database mysqltest; create table mysqltest.t1(n int); insert into mysqltest.t1 values (23); flush tables with read lock; drop database foo; select * from foo.t1; drop database mysqltest; select * from mysqltest.t1; n 23 unlock tables; Loading Loading
Docs/manual.texi +9 −1 Original line number Diff line number Diff line Loading @@ -35586,6 +35586,10 @@ In addition, a query may be seen as different if for instance one client is using a new communication protocol format or another character set than another client. Queries that uses different databases, uses different protocol versions or the uses different default character sets are considered different queries and cached separately. The cache does work for @code{SELECT CALC_ROWS ...} and @code{SELECT FOUND_ROWS() ...} type queries because the number of found rows is also stored in the cache. Loading Loading @@ -35624,8 +35628,12 @@ of the form @code{SELECT * FROM AUTOINCREMENT_FIELD IS NULL} However, @code{FOUND ROWS()} will return the correct value, even if the preceding query was fetched from the cache. Queries that don't use any tables are not cached. Queries that don't use any tables or if the user has a column privilege for any of the involved tables are not cached. Before a query is fetched from the query cache, MySQL will check that the user has SELECT privilege to all the involved databases and tables. If this is not the case, the cached result will not be used. @node Query Cache Configuration, Query Cache in SELECT, Query Cache How, Query Cache @subsection Query Cache Configuration
client/mysqltest.c +6 −3 Original line number Diff line number Diff line Loading @@ -1248,7 +1248,8 @@ int close_connection(struct st_query* q) } /* this one now is a hack - we may want to improve in in the /* This one now is a hack - we may want to improve in in the future to handle quotes. For now we assume that anything that is not a comma, a space or ) belongs to the argument. space is a chopper, comma or ) are delimiters/terminators Loading Loading @@ -1291,8 +1292,7 @@ int safe_connect(MYSQL* con, const char* host, const char* user, int i; for (i = 0; i < MAX_CON_TRIES; ++i) { if(mysql_real_connect(con, host,user, pass, db, port, sock, 0)) if (mysql_real_connect(con, host,user, pass, db, port, sock, 0)) { con_error = 0; break; Loading Loading @@ -1365,6 +1365,9 @@ int do_connect(struct st_query* q) con_sock=fn_format(buff, con_sock, TMPDIR, "",0); if (!con_db[0]) con_db=db; /* Special database to allow one to connect without a database name */ if (!strcmp(con_db,"*NO-ONE*")) con_db=0; if ((con_error = safe_connect(&next_con->mysql, con_host, con_user, con_pass, con_db, con_port, con_sock ? con_sock: 0))) Loading
include/raid.h +3 −1 Original line number Diff line number Diff line Loading @@ -22,8 +22,10 @@ #define RAID_DEFAULT_CHUNKS 4 #define RAID_DEFAULT_CHUNKSIZE 256*1024 /* 256kB */ extern const char *raid_type_string[]; C_MODE_START #define my_raid_type(raid_type) raid_type_string[(int)(raid_type)] extern const char *raid_type_string[]; C_MODE_END #if defined(USE_RAID) && !defined(DONT_USE_RAID) Loading
mysql-test/r/drop.result +18 −18 Original line number Diff line number Diff line Loading @@ -12,37 +12,37 @@ drop table t1; select * from t1; n 1 drop database if exists foo; create database foo; drop database if exists foo; create database foo; create table foo.foo (n int); insert into foo.foo values (4); select * from foo.foo; drop database if exists mysqltest; create database mysqltest; drop database if exists mysqltest; create database mysqltest; create table mysqltest.mysqltest (n int); insert into mysqltest.mysqltest values (4); select * from mysqltest.mysqltest; n 4 drop database if exists foo; create database foo; drop database foo; drop database if exists foo; drop database if exists mysqltest; create database mysqltest; drop database mysqltest; drop database if exists mysqltest; flush tables with read lock; create database foo; create database mysqltest; Got one of the listed errors unlock tables; create database foo; create database mysqltest; show databases; Database foo mysql mysqltest test flush tables with read lock; drop database foo; drop database mysqltest; Got one of the listed errors unlock tables; drop database foo; drop database mysqltest; show databases; Database mysql test drop database foo; Can't drop database 'foo'. Database doesn't exist drop database mysqltest; Can't drop database 'mysqltest'. Database doesn't exist
mysql-test/r/flush.result +6 −6 Original line number Diff line number Diff line Loading @@ -11,13 +11,13 @@ drop table t2; Table 't2' was locked with a READ lock and can't be updated drop table t2; unlock tables; drop database if exists foo; create database foo; create table foo.t1(n int); insert into foo.t1 values (23); drop database if exists mysqltest; create database mysqltest; create table mysqltest.t1(n int); insert into mysqltest.t1 values (23); flush tables with read lock; drop database foo; select * from foo.t1; drop database mysqltest; select * from mysqltest.t1; n 23 unlock tables; Loading