Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
21c137db
Commit
21c137db
authored
May 15, 2007
by
kostja@vajra.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into vajra.(none):/opt/local/work/mysql-4.1-runtime
parents
681ef616
4ea05eae
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
107 additions
and
2 deletions
+107
-2
mysql-test/r/query_cache.result
mysql-test/r/query_cache.result
+52
-0
mysql-test/t/query_cache.test
mysql-test/t/query_cache.test
+46
-0
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/set_var.cc
sql/set_var.cc
+6
-2
sql/sql_cache.cc
sql/sql_cache.cc
+2
-0
No files found.
mysql-test/r/query_cache.result
View file @
21c137db
...
...
@@ -1008,3 +1008,55 @@ Variable_name Value
Qcache_hits 1
drop table t1;
set GLOBAL query_cache_size=0;
create table t1 (a int);
insert into t1 values (1),(2),(3);
set GLOBAL query_cache_type=1;
set GLOBAL query_cache_limit=10000;
set GLOBAL query_cache_min_res_unit=0;
set GLOBAL query_cache_size= 100000;
reset query cache;
set LOCAL default_week_format = 0;
select week('2007-01-04');
week('2007-01-04')
0
select week('2007-01-04') from t1;
week('2007-01-04')
0
0
0
set LOCAL default_week_format = 2;
select week('2007-01-04');
week('2007-01-04')
53
select week('2007-01-04') from t1;
week('2007-01-04')
53
53
53
drop table t1;
CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b));
INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
('Full-text indexes', 'are called collections'),
('Only MyISAM tables','support collections'),
('Function MATCH ... AGAINST()','is used to do a search'),
('Full-text search in MySQL', 'implements vector space model');
set GLOBAL ft_boolean_syntax='+ -><()~*:""&|';
select *, MATCH(a,b) AGAINST("+called +collections" IN BOOLEAN MODE) as x from t1;
a b x
MySQL has now support for full-text search 0
Full-text indexes are called collections 1
Only MyISAM tables support collections 0
Function MATCH ... AGAINST() is used to do a search 0
Full-text search in MySQL implements vector space model 0
set GLOBAL ft_boolean_syntax='- +><()~*:""&|';
select *, MATCH(a,b) AGAINST("+called +collections" IN BOOLEAN MODE) as x from t1;
a b x
MySQL has now support for full-text search 0
Full-text indexes are called collections 0
Only MyISAM tables support collections 0
Function MATCH ... AGAINST() is used to do a search 0
Full-text search in MySQL implements vector space model 0
set GLOBAL query_cache_type=default;
set GLOBAL query_cache_limit=default;
set GLOBAL query_cache_min_res_unit=default;
set GLOBAL query_cache_size=default;
mysql-test/t/query_cache.test
View file @
21c137db
...
...
@@ -729,4 +729,50 @@ drop table t1;
set
GLOBAL
query_cache_size
=
0
;
#
# Bug #27792 query cache returns wrong result, with certain system variables
#
create
table
t1
(
a
int
);
insert
into
t1
values
(
1
),(
2
),(
3
);
set
GLOBAL
query_cache_type
=
1
;
set
GLOBAL
query_cache_limit
=
10000
;
set
GLOBAL
query_cache_min_res_unit
=
0
;
set
GLOBAL
query_cache_size
=
100000
;
# default_week_format
reset
query
cache
;
set
LOCAL
default_week_format
=
0
;
select
week
(
'2007-01-04'
);
select
week
(
'2007-01-04'
)
from
t1
;
set
LOCAL
default_week_format
=
2
;
select
week
(
'2007-01-04'
);
select
week
(
'2007-01-04'
)
from
t1
;
drop
table
t1
;
CREATE
TABLE
t1
(
a
VARCHAR
(
200
),
b
TEXT
,
FULLTEXT
(
a
,
b
));
INSERT
INTO
t1
VALUES
(
'MySQL has now support'
,
'for full-text search'
),
(
'Full-text indexes'
,
'are called collections'
),
(
'Only MyISAM tables'
,
'support collections'
),
(
'Function MATCH ... AGAINST()'
,
'is used to do a search'
),
(
'Full-text search in MySQL'
,
'implements vector space model'
);
set
GLOBAL
ft_boolean_syntax
=
'+ -><()~*:""&|'
;
select
*
,
MATCH
(
a
,
b
)
AGAINST
(
"+called +collections"
IN
BOOLEAN
MODE
)
as
x
from
t1
;
# swap +/-
set
GLOBAL
ft_boolean_syntax
=
'- +><()~*:""&|'
;
select
*
,
MATCH
(
a
,
b
)
AGAINST
(
"+called +collections"
IN
BOOLEAN
MODE
)
as
x
from
t1
;
set
GLOBAL
query_cache_type
=
default
;
set
GLOBAL
query_cache_limit
=
default
;
set
GLOBAL
query_cache_min_res_unit
=
default
;
set
GLOBAL
query_cache_size
=
default
;
# End of 4.1 tests
sql/mysql_priv.h
View file @
21c137db
...
...
@@ -426,6 +426,7 @@ struct Query_cache_query_flags
ulong
sql_mode
;
ulong
max_sort_length
;
ulong
group_concat_max_len
;
ulong
default_week_format
;
MY_LOCALE
*
lc_time_names
;
};
#define QUERY_CACHE_FLAGS_SIZE sizeof(Query_cache_query_flags)
...
...
sql/set_var.cc
View file @
21c137db
...
...
@@ -490,7 +490,7 @@ static sys_var_rand_seed1 sys_rand_seed1("rand_seed1");
static
sys_var_rand_seed2
sys_rand_seed2
(
"rand_seed2"
);
static
sys_var_thd_ulong
sys_default_week_format
(
"default_week_format"
,
&
SV
::
default_week_format
);
&
SV
::
default_week_format
);
sys_var_thd_ulong
sys_group_concat_max_len
(
"group_concat_max_len"
,
&
SV
::
group_concat_max_len
);
...
...
@@ -992,7 +992,6 @@ bool update_sys_var_str(sys_var_str *var_str, rw_lock_t *var_mutex,
return
0
;
}
static
bool
sys_update_init_connect
(
THD
*
thd
,
set_var
*
var
)
{
return
update_sys_var_str
(
&
sys_init_connect
,
&
LOCK_sys_init_connect
,
var
);
...
...
@@ -1032,6 +1031,11 @@ static bool sys_update_ftb_syntax(THD *thd, set_var * var)
{
strmake
(
ft_boolean_syntax
,
var
->
value
->
str_value
.
c_ptr
(),
sizeof
(
ft_boolean_syntax
)
-
1
);
#ifdef HAVE_QUERY_CACHE
query_cache
.
flush
();
#endif
/* HAVE_QUERY_CACHE */
return
0
;
}
...
...
sql/sql_cache.cc
View file @
21c137db
...
...
@@ -813,6 +813,7 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
flags
.
sql_mode
=
thd
->
variables
.
sql_mode
;
flags
.
max_sort_length
=
thd
->
variables
.
max_sort_length
;
flags
.
group_concat_max_len
=
thd
->
variables
.
group_concat_max_len
;
flags
.
default_week_format
=
thd
->
variables
.
default_week_format
;
flags
.
lc_time_names
=
thd
->
variables
.
lc_time_names
;
STRUCT_LOCK
(
&
structure_guard_mutex
);
...
...
@@ -1016,6 +1017,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
flags
.
sql_mode
=
thd
->
variables
.
sql_mode
;
flags
.
max_sort_length
=
thd
->
variables
.
max_sort_length
;
flags
.
group_concat_max_len
=
thd
->
variables
.
group_concat_max_len
;
flags
.
default_week_format
=
thd
->
variables
.
default_week_format
;
flags
.
lc_time_names
=
thd
->
variables
.
lc_time_names
;
memcpy
((
void
*
)(
sql
+
(
tot_length
-
QUERY_CACHE_FLAGS_SIZE
)),
&
flags
,
QUERY_CACHE_FLAGS_SIZE
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment