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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
2090d579
Commit
2090d579
authored
Aug 26, 2003
by
igor@rurik.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
key_cache.result, sql_lex.h, sql_yacc.yy, set_var.cc, sql_lex.cc:
After merge fix
parent
3f6daf6e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
34 deletions
+43
-34
mysql-test/r/key_cache.result
mysql-test/r/key_cache.result
+2
-2
sql/set_var.cc
sql/set_var.cc
+26
-20
sql/sql_lex.cc
sql/sql_lex.cc
+3
-0
sql/sql_lex.h
sql/sql_lex.h
+2
-2
sql/sql_yacc.yy
sql/sql_yacc.yy
+10
-10
No files found.
mysql-test/r/key_cache.result
View file @
2090d579
...
@@ -77,7 +77,7 @@ select @@keycache1.key_cache_block_size;
...
@@ -77,7 +77,7 @@ select @@keycache1.key_cache_block_size;
0
0
select @@key_buffer_size;
select @@key_buffer_size;
@@key_buffer_size
@@key_buffer_size
16777216
2097152
select @@key_cache_block_size;
select @@key_cache_block_size;
@@key_cache_block_size
@@key_cache_block_size
1024
1024
...
@@ -121,7 +121,7 @@ i
...
@@ -121,7 +121,7 @@ i
explain select count(*) from t1, t2 where t1.p = t2.i;
explain select count(*) from t1, t2 where t1.p = t2.i;
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 2 Using index
1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 2 Using index
1 SIMPLE t2
index k1 k1 5 NULL 4
Using where; Using index
1 SIMPLE t2
ref k1 k1 5 test.t1.p 2
Using where; Using index
select count(*) from t1, t2 where t1.p = t2.i;
select count(*) from t1, t2 where t1.p = t2.i;
count(*)
count(*)
3
3
...
...
sql/set_var.cc
View file @
2090d579
...
@@ -1507,7 +1507,8 @@ static KEY_CACHE_VAR *get_key_cache(LEX_STRING *cache_name)
...
@@ -1507,7 +1507,8 @@ static KEY_CACHE_VAR *get_key_cache(LEX_STRING *cache_name)
default_key_cache_base
.
length
)))
default_key_cache_base
.
length
)))
cache_name
=
&
default_key_cache_base
;
cache_name
=
&
default_key_cache_base
;
return
((
KEY_CACHE_VAR
*
)
find_named
(
&
key_caches
,
return
((
KEY_CACHE_VAR
*
)
find_named
(
&
key_caches
,
cache_name
->
str
,
cache_name
->
length
));
cache_name
->
str
,
cache_name
->
length
,
0
));
}
}
byte
*
sys_var_key_cache_param
::
value_ptr
(
THD
*
thd
,
enum_var_type
type
,
byte
*
sys_var_key_cache_param
::
value_ptr
(
THD
*
thd
,
enum_var_type
type
,
...
@@ -1519,23 +1520,20 @@ byte *sys_var_key_cache_param::value_ptr(THD *thd, enum_var_type type,
...
@@ -1519,23 +1520,20 @@ byte *sys_var_key_cache_param::value_ptr(THD *thd, enum_var_type type,
return
(
byte
*
)
key_cache
+
offset
;
return
(
byte
*
)
key_cache
+
offset
;
}
}
bool
sys_var_key_buffer_size
::
update
(
THD
*
thd
,
set_var
*
var
bool
sys_var_key_buffer_size
::
update
(
THD
*
thd
,
set_var
*
var
)
{
ulonglong
tmp
=
var
->
value
->
val_int
();
ulonglong
tmp
=
var
->
value
->
val_int
();
base_name
=
&
default_key_cache_base
;
LEX_STRING
*
base_name
=
&
var
->
base
;
if
(
!
base_name
->
length
)
base_name
=
&
default_key_cache_base
;
KEY_CACHE_VAR
*
key_cache
=
get_key_cache
(
base_name
);
KEY_CACHE_VAR
*
key_cache
=
get_key_cache
(
base_name
);
}
KEY_CACHE
*
key_cache
=
(
KEY_CACHE
*
)
find_named
(
&
key_caches
,
base_name
.
str
,
base_name
.
length
);
if
(
!
key_cache
)
if
(
!
key_cache
)
{
{
if
(
!
tmp
)
// Tried to delete cache
if
(
!
tmp
)
// Tried to delete cache
return
0
;
// Ok, nothing to do
return
0
;
// Ok, nothing to do
if
(
!
(
key_cache
=
create_key_cache
(
base_name
->
str
,
if
(
!
(
key_cache
=
create_key_cache
(
base_name
->
str
,
base_name
->
length
)
base_name
->
length
)
))
return
1
;
return
1
;
}
}
if
(
!
tmp
)
// Zero size means delete
if
(
!
tmp
)
// Zero size means delete
...
@@ -1549,8 +1547,15 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var
...
@@ -1549,8 +1547,15 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var
Move tables using this key cache to the default key cache
Move tables using this key cache to the default key cache
and remove this key cache if no tables are assigned to it
and remove this key cache if no tables are assigned to it
*/
*/
return
(
reassign_keycache_tables
(
thd
,
key_cache
,
NAMED_LIST
*
list
;
default_key_cache_base
.
str
,
1
));
key_cache
=
(
KEY_CACHE_VAR
*
)
find_named
(
&
key_caches
,
base_name
->
str
,
base_name
->
length
,
&
list
);
delete
list
;
int
rc
=
reassign_keycache_tables
(
thd
,
key_cache
,
default_key_cache_base
.
str
,
1
);
my_free
((
char
*
)
key_cache
,
MYF
(
0
));
return
rc
;
}
}
return
0
;
return
0
;
}
}
...
@@ -1566,8 +1571,8 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var
...
@@ -1566,8 +1571,8 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var
bool
sys_var_key_cache_block_size
::
update
(
THD
*
thd
,
set_var
*
var
)
bool
sys_var_key_cache_block_size
::
update
(
THD
*
thd
,
set_var
*
var
)
{
{
ulong
tmp
=
var
->
value
->
val_int
();
ulong
tmp
=
var
->
value
->
val_int
();
LEX_STRING
*
base_name
=
&
var
->
base
;
if
(
!
base_name
.
length
)
if
(
!
base_name
->
length
)
base_name
=
&
default_key_cache_base
;
base_name
=
&
default_key_cache_base
;
KEY_CACHE_VAR
*
key_cache
=
get_key_cache
(
base_name
);
KEY_CACHE_VAR
*
key_cache
=
get_key_cache
(
base_name
);
...
@@ -1586,8 +1591,8 @@ bool sys_var_key_cache_block_size::update(THD *thd, set_var *var)
...
@@ -1586,8 +1591,8 @@ bool sys_var_key_cache_block_size::update(THD *thd, set_var *var)
bool
sys_var_key_cache_division_limit
::
update
(
THD
*
thd
,
set_var
*
var
)
bool
sys_var_key_cache_division_limit
::
update
(
THD
*
thd
,
set_var
*
var
)
{
{
ulong
tmp
=
var
->
value
->
val_int
();
ulong
tmp
=
var
->
value
->
val_int
();
LEX_STRING
*
base_name
=
&
var
->
base
;
if
(
!
base_name
.
length
)
if
(
!
base_name
->
length
)
base_name
=
&
default_key_cache_base
;
base_name
=
&
default_key_cache_base
;
KEY_CACHE_VAR
*
key_cache
=
get_key_cache
(
base_name
);
KEY_CACHE_VAR
*
key_cache
=
get_key_cache
(
base_name
);
...
@@ -1604,11 +1609,11 @@ bool sys_var_key_cache_division_limit::update(THD *thd, set_var *var)
...
@@ -1604,11 +1609,11 @@ bool sys_var_key_cache_division_limit::update(THD *thd, set_var *var)
return
0
;
return
0
;
}
}
bool
sys_var_key_age_threshold
::
update
(
THD
*
thd
,
set_var
*
var
)
bool
sys_var_key_
cache_
age_threshold
::
update
(
THD
*
thd
,
set_var
*
var
)
{
{
ulong
tmp
=
var
->
value
->
val_int
();
ulong
tmp
=
var
->
value
->
val_int
();
LEX_STRING
*
base_name
=
&
var
->
base
;
if
(
!
base_name
.
length
)
if
(
!
base_name
->
length
)
base_name
=
&
default_key_cache_base
;
base_name
=
&
default_key_cache_base
;
KEY_CACHE_VAR
*
key_cache
=
get_key_cache
(
base_name
);
KEY_CACHE_VAR
*
key_cache
=
get_key_cache
(
base_name
);
...
@@ -2195,7 +2200,8 @@ gptr find_named(I_List<NAMED_LIST> *list, const char *name, uint length,
...
@@ -2195,7 +2200,8 @@ gptr find_named(I_List<NAMED_LIST> *list, const char *name, uint length,
{
{
if
(
element
->
cmp
(
name
,
length
))
if
(
element
->
cmp
(
name
,
length
))
{
{
*
found
=
element
;
if
(
found
)
*
found
=
element
;
return
element
->
data
;
return
element
->
data
;
}
}
}
}
...
...
sql/sql_lex.cc
View file @
2090d579
...
@@ -1174,6 +1174,9 @@ TABLE_LIST *st_select_lex_node::add_table_to_list(THD *thd, Table_ident *table,
...
@@ -1174,6 +1174,9 @@ TABLE_LIST *st_select_lex_node::add_table_to_list(THD *thd, Table_ident *table,
List
<
String
>
*
use_index
,
List
<
String
>
*
use_index
,
List
<
String
>
*
ignore_index
,
List
<
String
>
*
ignore_index
,
LEX_STRING
*
option
)
LEX_STRING
*
option
)
{
return
0
;
}
ulong
st_select_lex_node
::
get_table_join_options
()
ulong
st_select_lex_node
::
get_table_join_options
()
{
{
return
0
;
return
0
;
...
...
sql/sql_lex.h
View file @
2090d579
...
@@ -437,8 +437,8 @@ class st_select_lex: public st_select_lex_node
...
@@ -437,8 +437,8 @@ class st_select_lex: public st_select_lex_node
ulong
table_options
,
ulong
table_options
,
thr_lock_type
flags
=
TL_UNLOCK
,
thr_lock_type
flags
=
TL_UNLOCK
,
List
<
String
>
*
use_index
=
0
,
List
<
String
>
*
use_index
=
0
,
List
<
String
>
*
ignore_index
=
0
);
List
<
String
>
*
ignore_index
=
0
,
LEX_STRING
*
option
=
0
);
TABLE_LIST
*
get_table_list
();
TABLE_LIST
*
get_table_list
();
List
<
Item
>*
get_item_list
();
List
<
Item
>*
get_item_list
();
List
<
String
>*
get_use_index
();
List
<
String
>*
get_use_index
();
...
...
sql/sql_yacc.yy
View file @
2090d579
...
@@ -1946,16 +1946,16 @@ preload_keys:
...
@@ -1946,16 +1946,16 @@ preload_keys:
}
}
;
;
preload
_keys_spec:
cache
_keys_spec:
keys_or_index { Select->interval_list.empty(); }
keys_or_index { Select->interval_list.empty(); }
cache_key_list_or_empty
cache_key_list_or_empty
{
{
LEX *lex=Lex;
LEX *lex=Lex;
SELECT_LEX *sel= &lex->select_lex;
SELECT_LEX *sel= &lex->select_lex;
sel->use_index= sel->interval_list;
sel->use_index= sel->interval_list;
sel->use_index_ptr= &sel->use_index;
sel->use_index_ptr= &sel->use_index;
}
}
;
;
cache_key_list_or_empty:
cache_key_list_or_empty:
/* empty */
/* empty */
...
...
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