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
ca61e54c
Commit
ca61e54c
authored
Nov 23, 2004
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed query cache type variable for ndb
parent
49b02a8f
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
20 deletions
+46
-20
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+14
-5
sql/ha_ndbcluster.h
sql/ha_ndbcluster.h
+1
-1
sql/mysqld.cc
sql/mysqld.cc
+11
-7
sql/set_var.cc
sql/set_var.cc
+12
-6
sql/sql_cache.cc
sql/sql_cache.cc
+6
-0
sql/sql_cache.h
sql/sql_cache.h
+1
-0
sql/sql_class.h
sql/sql_class.h
+1
-1
No files found.
sql/ha_ndbcluster.cc
View file @
ca61e54c
...
@@ -3025,7 +3025,9 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
...
@@ -3025,7 +3025,9 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
m_transaction_on
=
FALSE
;
m_transaction_on
=
FALSE
;
else
else
m_transaction_on
=
thd
->
variables
.
ndb_use_transactions
;
m_transaction_on
=
thd
->
variables
.
ndb_use_transactions
;
m_use_local_query_cache
=
thd
->
variables
.
ndb_use_local_query_cache
;
#ifdef HAVE_QUERY_CACHE
m_query_cache_type
=
thd
->
variables
.
ndb_query_cache_type
;
#endif
m_active_trans
=
thd
->
transaction
.
all
.
ndb_tid
?
m_active_trans
=
thd
->
transaction
.
all
.
ndb_tid
?
(
NdbConnection
*
)
thd
->
transaction
.
all
.
ndb_tid
:
(
NdbConnection
*
)
thd
->
transaction
.
all
.
ndb_tid
:
...
@@ -3751,7 +3753,7 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg):
...
@@ -3751,7 +3753,7 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg):
m_force_send
(
TRUE
),
m_force_send
(
TRUE
),
m_autoincrement_prefetch
(
32
),
m_autoincrement_prefetch
(
32
),
m_transaction_on
(
TRUE
),
m_transaction_on
(
TRUE
),
m_
use_local_query_cache
(
FALSE
)
m_
query_cache_type
(
0
)
{
{
int
i
;
int
i
;
...
@@ -4455,10 +4457,17 @@ const char* ha_ndbcluster::index_type(uint key_number)
...
@@ -4455,10 +4457,17 @@ const char* ha_ndbcluster::index_type(uint key_number)
}
}
uint8
ha_ndbcluster
::
table_cache_type
()
uint8
ha_ndbcluster
::
table_cache_type
()
{
{
if
(
m_use_local_query_cache
)
switch
(
m_query_cache_type
)
{
case
0
:
return
HA_CACHE_TBL_NOCACHE
;
case
1
:
return
HA_CACHE_TBL_ASKTRANSACT
;
case
2
:
return
HA_CACHE_TBL_TRANSACT
;
return
HA_CACHE_TBL_TRANSACT
;
else
default:
return
HA_CACHE_TBL_NOCACHE
;
return
HA_CACHE_TBL_NOCACHE
;
}
}
}
/*
/*
...
...
sql/ha_ndbcluster.h
View file @
ca61e54c
...
@@ -244,7 +244,7 @@ class ha_ndbcluster: public handler
...
@@ -244,7 +244,7 @@ class ha_ndbcluster: public handler
bool
m_force_send
;
bool
m_force_send
;
ha_rows
m_autoincrement_prefetch
;
ha_rows
m_autoincrement_prefetch
;
bool
m_transaction_on
;
bool
m_transaction_on
;
bool
m_use_local_query_cach
e
;
ulong
m_query_cache_typ
e
;
void
set_rec_per_key
();
void
set_rec_per_key
();
void
records_update
();
void
records_update
();
...
...
sql/mysqld.cc
View file @
ca61e54c
...
@@ -3954,7 +3954,7 @@ enum options_mysqld
...
@@ -3954,7 +3954,7 @@ enum options_mysqld
OPT_INNODB
,
OPT_ISAM
,
OPT_INNODB
,
OPT_ISAM
,
OPT_NDBCLUSTER
,
OPT_NDB_CONNECTSTRING
,
OPT_NDB_USE_EXACT_COUNT
,
OPT_NDBCLUSTER
,
OPT_NDB_CONNECTSTRING
,
OPT_NDB_USE_EXACT_COUNT
,
OPT_NDB_FORCE_SEND
,
OPT_NDB_AUTOINCREMENT_PREFETCH_SZ
,
OPT_NDB_FORCE_SEND
,
OPT_NDB_AUTOINCREMENT_PREFETCH_SZ
,
OPT_NDB_
USE_LOCAL_QUERY_CACH
E
,
OPT_NDB_
QUERY_CACHE_TYP
E
,
OPT_SKIP_SAFEMALLOC
,
OPT_SKIP_SAFEMALLOC
,
OPT_TEMP_POOL
,
OPT_TX_ISOLATION
,
OPT_TEMP_POOL
,
OPT_TX_ISOLATION
,
OPT_SKIP_STACK_TRACE
,
OPT_SKIP_SYMLINKS
,
OPT_SKIP_STACK_TRACE
,
OPT_SKIP_SYMLINKS
,
...
@@ -4414,12 +4414,16 @@ Disable with --skip-ndbcluster (will save memory).",
...
@@ -4414,12 +4414,16 @@ Disable with --skip-ndbcluster (will save memory).",
(
gptr
*
)
&
global_system_variables
.
ndb_use_exact_count
,
(
gptr
*
)
&
global_system_variables
.
ndb_use_exact_count
,
(
gptr
*
)
&
global_system_variables
.
ndb_use_exact_count
,
(
gptr
*
)
&
global_system_variables
.
ndb_use_exact_count
,
0
,
GET_BOOL
,
OPT_ARG
,
1
,
0
,
0
,
0
,
0
,
0
},
0
,
GET_BOOL
,
OPT_ARG
,
1
,
0
,
0
,
0
,
0
,
0
},
{
"ndb_use_local_query_cache"
,
OPT_NDB_USE_LOCAL_QUERY_CACHE
,
#ifdef HAVE_QUERY_CACHE
"Use local query cache, note that this cache will _not_ "
{
"ndb_query_cache_type"
,
OPT_NDB_QUERY_CACHE_TYPE
,
"be invalidated if data is updated through other mysql servers"
,
"0 = OFF = Don't cache or retrieve results. 1 = ON = Cache as query_cache_type states and "
(
gptr
*
)
&
global_system_variables
.
ndb_use_local_query_cache
,
"invalidate cache if tables are updated by other mysql servers. "
(
gptr
*
)
&
global_system_variables
.
ndb_use_local_query_cache
,
"2 = LOCAL = Cache as query_cache_type states and don't bother about what's happening on other "
0
,
GET_BOOL
,
OPT_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
"mysql servers."
,
(
gptr
*
)
&
global_system_variables
.
ndb_query_cache_type
,
(
gptr
*
)
&
global_system_variables
.
ndb_query_cache_type
,
0
,
GET_ULONG
,
REQUIRED_ARG
,
0
,
0
,
2
,
0
,
0
,
0
},
#endif
#endif
#endif
{
"new"
,
'n'
,
"Use very new possible 'unsafe' functions."
,
{
"new"
,
'n'
,
"Use very new possible 'unsafe' functions."
,
(
gptr
*
)
&
global_system_variables
.
new_mode
,
(
gptr
*
)
&
global_system_variables
.
new_mode
,
...
...
sql/set_var.cc
View file @
ca61e54c
...
@@ -370,9 +370,12 @@ sys_ndb_force_send("ndb_force_send",
...
@@ -370,9 +370,12 @@ sys_ndb_force_send("ndb_force_send",
sys_var_thd_bool
sys_var_thd_bool
sys_ndb_use_exact_count
(
"ndb_use_exact_count"
,
sys_ndb_use_exact_count
(
"ndb_use_exact_count"
,
&
SV
::
ndb_use_exact_count
);
&
SV
::
ndb_use_exact_count
);
sys_var_thd_bool
#ifdef HAVE_QUERY_CACHE
sys_ndb_use_local_query_cache
(
"ndb_use_local_query_cache"
,
sys_var_thd_enum
&
SV
::
ndb_use_local_query_cache
);
sys_ndb_query_cache_type
(
"ndb_query_cache_type"
,
&
SV
::
ndb_query_cache_type
,
&
ndb_query_cache_type_typelib
);
#endif
sys_var_thd_bool
sys_var_thd_bool
sys_ndb_use_transactions
(
"ndb_use_transactions"
,
sys_ndb_use_transactions
(
"ndb_use_transactions"
,
&
SV
::
ndb_use_transactions
);
&
SV
::
ndb_use_transactions
);
...
@@ -637,7 +640,9 @@ sys_var *sys_variables[]=
...
@@ -637,7 +640,9 @@ sys_var *sys_variables[]=
&
sys_ndb_autoincrement_prefetch_sz
,
&
sys_ndb_autoincrement_prefetch_sz
,
&
sys_ndb_force_send
,
&
sys_ndb_force_send
,
&
sys_ndb_use_exact_count
,
&
sys_ndb_use_exact_count
,
&
sys_ndb_use_local_query_cache
,
#ifdef HAVE_QUERY_CACHE
&
sys_ndb_query_cache_type
,
#endif
&
sys_ndb_use_transactions
,
&
sys_ndb_use_transactions
,
#endif
#endif
&
sys_unique_checks
,
&
sys_unique_checks
,
...
@@ -805,8 +810,9 @@ struct show_var_st init_vars[]= {
...
@@ -805,8 +810,9 @@ struct show_var_st init_vars[]= {
(
char
*
)
&
sys_ndb_autoincrement_prefetch_sz
,
SHOW_SYS
},
(
char
*
)
&
sys_ndb_autoincrement_prefetch_sz
,
SHOW_SYS
},
{
sys_ndb_force_send
.
name
,
(
char
*
)
&
sys_ndb_force_send
,
SHOW_SYS
},
{
sys_ndb_force_send
.
name
,
(
char
*
)
&
sys_ndb_force_send
,
SHOW_SYS
},
{
sys_ndb_use_exact_count
.
name
,(
char
*
)
&
sys_ndb_use_exact_count
,
SHOW_SYS
},
{
sys_ndb_use_exact_count
.
name
,(
char
*
)
&
sys_ndb_use_exact_count
,
SHOW_SYS
},
{
sys_ndb_use_local_query_cache
.
name
,
#ifdef HAVE_QUERY_CACHE
(
char
*
)
&
sys_ndb_use_local_query_cache
,
SHOW_SYS
},
{
sys_ndb_query_cache_type
.
name
,(
char
*
)
&
sys_ndb_query_cache_type
,
SHOW_SYS
},
#endif
{
sys_ndb_use_transactions
.
name
,(
char
*
)
&
sys_ndb_use_transactions
,
SHOW_SYS
},
{
sys_ndb_use_transactions
.
name
,(
char
*
)
&
sys_ndb_use_transactions
,
SHOW_SYS
},
#endif
#endif
{
sys_net_buffer_length
.
name
,(
char
*
)
&
sys_net_buffer_length
,
SHOW_SYS
},
{
sys_net_buffer_length
.
name
,(
char
*
)
&
sys_net_buffer_length
,
SHOW_SYS
},
...
...
sql/sql_cache.cc
View file @
ca61e54c
...
@@ -366,6 +366,12 @@ TYPELIB query_cache_type_typelib=
...
@@ -366,6 +366,12 @@ TYPELIB query_cache_type_typelib=
array_elements
(
query_cache_type_names
)
-
1
,
""
,
query_cache_type_names
,
NULL
array_elements
(
query_cache_type_names
)
-
1
,
""
,
query_cache_type_names
,
NULL
};
};
const
char
*
ndb_query_cache_type_names
[]
=
{
"OFF"
,
"ON"
,
"LOCAL"
,
NullS
};
TYPELIB
ndb_query_cache_type_typelib
=
{
array_elements
(
ndb_query_cache_type_names
)
-
1
,
""
,
ndb_query_cache_type_names
,
NULL
};
/*****************************************************************************
/*****************************************************************************
Query_cache_block_table method(s)
Query_cache_block_table method(s)
*****************************************************************************/
*****************************************************************************/
...
...
sql/sql_cache.h
View file @
ca61e54c
...
@@ -412,6 +412,7 @@ protected:
...
@@ -412,6 +412,7 @@ protected:
};
};
extern
Query_cache
query_cache
;
extern
Query_cache
query_cache
;
extern
TYPELIB
ndb_query_cache_type_typelib
;
extern
TYPELIB
query_cache_type_typelib
;
extern
TYPELIB
query_cache_type_typelib
;
void
query_cache_end_of_result
(
THD
*
thd
);
void
query_cache_end_of_result
(
THD
*
thd
);
void
query_cache_abort
(
NET
*
net
);
void
query_cache_abort
(
NET
*
net
);
...
...
sql/sql_class.h
View file @
ca61e54c
...
@@ -403,7 +403,7 @@ struct system_variables
...
@@ -403,7 +403,7 @@ struct system_variables
ulong
ndb_autoincrement_prefetch_sz
;
ulong
ndb_autoincrement_prefetch_sz
;
my_bool
ndb_force_send
;
my_bool
ndb_force_send
;
my_bool
ndb_use_exact_count
;
my_bool
ndb_use_exact_count
;
my_bool
ndb_use_local_query_cach
e
;
ulong
ndb_query_cache_typ
e
;
my_bool
ndb_use_transactions
;
my_bool
ndb_use_transactions
;
#endif
/* HAVE_NDBCLUSTER_DB */
#endif
/* HAVE_NDBCLUSTER_DB */
my_bool
old_passwords
;
my_bool
old_passwords
;
...
...
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