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
6fa209f7
Commit
6fa209f7
authored
Feb 10, 2012
by
Michael Widenius
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge
parents
f6cdddf5
ea45d770
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
sql/sql_cache.cc
sql/sql_cache.cc
+25
-0
No files found.
sql/sql_cache.cc
View file @
6fa209f7
...
@@ -1659,6 +1659,17 @@ Query_cache::send_result_to_client(THD *thd, char *org_sql, uint query_length)
...
@@ -1659,6 +1659,17 @@ Query_cache::send_result_to_client(THD *thd, char *org_sql, uint query_length)
if
(
is_disabled
()
||
thd
->
locked_tables
||
if
(
is_disabled
()
||
thd
->
locked_tables
||
thd
->
variables
.
query_cache_type
==
0
)
thd
->
variables
.
query_cache_type
==
0
)
goto
err
;
goto
err
;
/*
The following can only happen for prepared statements that was found
during parsing or later that the query was not cacheable.
*/
if
(
!
thd
->
lex
->
safe_to_cache_query
)
{
DBUG_PRINT
(
"qcache"
,
(
"SELECT is non-cacheable"
));
goto
err
;
}
DBUG_ASSERT
(
query_cache_size
!=
0
);
// otherwise cache would be disabled
DBUG_ASSERT
(
query_cache_size
!=
0
);
// otherwise cache would be disabled
thd
->
query_cache_is_applicable
=
1
;
thd
->
query_cache_is_applicable
=
1
;
...
@@ -1950,6 +1961,7 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
...
@@ -1950,6 +1961,7 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
faster.
faster.
*/
*/
thd
->
query_cache_is_applicable
=
0
;
// Query can't be cached
thd
->
query_cache_is_applicable
=
0
;
// Query can't be cached
thd
->
lex
->
safe_to_cache_query
=
0
;
// For prepared statements
BLOCK_UNLOCK_RD
(
query_block
);
BLOCK_UNLOCK_RD
(
query_block
);
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
}
}
...
@@ -1966,6 +1978,7 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
...
@@ -1966,6 +1978,7 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
table_list
.
db
,
table_list
.
alias
));
table_list
.
db
,
table_list
.
alias
));
unlock
();
unlock
();
thd
->
query_cache_is_applicable
=
0
;
// Query can't be cached
thd
->
query_cache_is_applicable
=
0
;
// Query can't be cached
thd
->
lex
->
safe_to_cache_query
=
0
;
// For prepared statements
BLOCK_UNLOCK_RD
(
query_block
);
BLOCK_UNLOCK_RD
(
query_block
);
DBUG_RETURN
(
-
1
);
// Privilege error
DBUG_RETURN
(
-
1
);
// Privilege error
}
}
...
@@ -1975,6 +1988,7 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
...
@@ -1975,6 +1988,7 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
table_list
.
db
,
table_list
.
alias
));
table_list
.
db
,
table_list
.
alias
));
BLOCK_UNLOCK_RD
(
query_block
);
BLOCK_UNLOCK_RD
(
query_block
);
thd
->
query_cache_is_applicable
=
0
;
// Query can't be cached
thd
->
query_cache_is_applicable
=
0
;
// Query can't be cached
thd
->
lex
->
safe_to_cache_query
=
0
;
// For prepared statements
goto
err_unlock
;
// Parse query
goto
err_unlock
;
// Parse query
}
}
#endif
/*!NO_EMBEDDED_ACCESS_CHECKS*/
#endif
/*!NO_EMBEDDED_ACCESS_CHECKS*/
...
@@ -1998,7 +2012,13 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
...
@@ -1998,7 +2012,13 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
table
->
key_length
());
table
->
key_length
());
}
}
else
else
{
/*
As this can change from call to call, don't reset set
thd->lex->safe_to_cache_query
*/
thd
->
query_cache_is_applicable
=
0
;
// Query can't be cached
thd
->
query_cache_is_applicable
=
0
;
// Query can't be cached
}
goto
err_unlock
;
// Parse query
goto
err_unlock
;
// Parse query
}
}
else
else
...
@@ -3886,6 +3906,7 @@ Query_cache::process_and_count_tables(THD *thd, TABLE_LIST *tables_used,
...
@@ -3886,6 +3906,7 @@ Query_cache::process_and_count_tables(THD *thd, TABLE_LIST *tables_used,
DBUG_PRINT
(
"qcache"
,
(
"Don't cache statement as it refers to "
DBUG_PRINT
(
"qcache"
,
(
"Don't cache statement as it refers to "
"tables with column privileges."
));
"tables with column privileges."
));
thd
->
query_cache_is_applicable
=
0
;
// Query can't be cached
thd
->
query_cache_is_applicable
=
0
;
// Query can't be cached
thd
->
lex
->
safe_to_cache_query
=
0
;
// For prepared statements
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
#endif
#endif
...
@@ -4022,6 +4043,10 @@ my_bool Query_cache::ask_handler_allowance(THD *thd,
...
@@ -4022,6 +4043,10 @@ my_bool Query_cache::ask_handler_allowance(THD *thd,
{
{
DBUG_PRINT
(
"qcache"
,
(
"Handler does not allow caching for %s.%s"
,
DBUG_PRINT
(
"qcache"
,
(
"Handler does not allow caching for %s.%s"
,
tables_used
->
db
,
tables_used
->
alias
));
tables_used
->
db
,
tables_used
->
alias
));
/*
As this can change from call to call, don't reset set
thd->lex->safe_to_cache_query
*/
thd
->
query_cache_is_applicable
=
0
;
// Query can't be cached
thd
->
query_cache_is_applicable
=
0
;
// Query can't be cached
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
...
...
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