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
3c8b9ed6
Commit
3c8b9ed6
authored
Feb 04, 2013
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge fix for MDEV-3997.
parents
a3e64c86
6ae14e6c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
1 deletion
+93
-1
mysql-test/suite/plugins/r/cassandra_qcache.result
mysql-test/suite/plugins/r/cassandra_qcache.result
+16
-0
mysql-test/suite/plugins/suite.pm
mysql-test/suite/plugins/suite.pm
+3
-1
mysql-test/suite/plugins/t/cassandra_qcache.opt
mysql-test/suite/plugins/t/cassandra_qcache.opt
+1
-0
mysql-test/suite/plugins/t/cassandra_qcache.test
mysql-test/suite/plugins/t/cassandra_qcache.test
+59
-0
storage/cassandra/ha_cassandra.h
storage/cassandra/ha_cassandra.h
+14
-0
No files found.
mysql-test/suite/plugins/r/cassandra_qcache.result
0 → 100644
View file @
3c8b9ed6
drop table if exists t1, t2;
create table t1 (rowkey int primary key, a int) engine=cassandra
thrift_host='localhost' keyspace='mariadbtest2' column_family='cf1';
create table t2 like t1;
set global query_cache_size=1024*1024;
select * from t1;
rowkey a
insert into t2 values (1,1);
select * from t1;
rowkey a
1 1
select sql_no_cache * from t1;
rowkey a
1 1
drop table t1,t2;
set global QUERY_CACHE_SIZE=0;
mysql-test/suite/plugins/suite.pm
View file @
3c8b9ed6
package
My::Suite::
Plugins
;
use
My::
Platform
;
@ISA
=
qw(My::Suite)
;
sub
cassandra_running
()
{
return
0
if
IS_WINDOW
;
return
0
if
IS_WINDOW
S
;
system
'
echo show version | cqlsh -3 2>/dev/null >/dev/null
';
return
$?
==
0
;
}
...
...
mysql-test/suite/plugins/t/cassandra_qcache.opt
0 → 100644
View file @
3c8b9ed6
--plugin-load=$HA_CASSANDRA_SO --loose-cassandra=on
mysql-test/suite/plugins/t/cassandra_qcache.test
0 → 100644
View file @
3c8b9ed6
#
# Tests for cassandra storage engine
#
--
source
include
/
have_query_cache
.
inc
if
(
`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'cassandra' AND support IN ('YES', 'DEFAULT', 'ENABLED')`
)
{
--
skip
Test
requires
Cassandra
.
}
--
disable_warnings
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
############################################################################
## Cassandra initialization
############################################################################
# Step 1: remove the keyspace that could be left over from the previous test
--
remove_files_wildcard
$MYSQLTEST_VARDIR
cassandra_test_cleanup
.
cql
--
write_file
$MYSQLTEST_VARDIR
/
cassandra_test_cleanup
.
cql
drop
keyspace
mariadbtest2
;
EOF
--
error
0
,
1
,
2
--
system
cqlsh
-
3
-
f
$MYSQLTEST_VARDIR
/
cassandra_test_cleanup
.
cql
# Step 2: create new keyspace and test column families
--
remove_files_wildcard
$MYSQLTEST_VARDIR
cassandra_test_init
.
cql
--
write_file
$MYSQLTEST_VARDIR
/
cassandra_test_init
.
cql
CREATE
KEYSPACE
mariadbtest2
WITH
strategy_class
=
'org.apache.cassandra.locator.SimpleStrategy'
AND
strategy_options
:
replication_factor
=
'1'
;
USE
mariadbtest2
;
create
columnfamily
cf1
(
rowkey
int
primary
key
,
a
int
);
EOF
--
error
0
,
1
,
2
--
system
cqlsh
-
3
-
f
$MYSQLTEST_VARDIR
/
cassandra_test_init
.
cql
############################################################################
## The test itsef:
############################################################################
create
table
t1
(
rowkey
int
primary
key
,
a
int
)
engine
=
cassandra
thrift_host
=
'localhost'
keyspace
=
'mariadbtest2'
column_family
=
'cf1'
;
create
table
t2
like
t1
;
set
global
query_cache_size
=
1024
*
1024
;
select
*
from
t1
;
insert
into
t2
values
(
1
,
1
);
select
*
from
t1
;
select
sql_no_cache
*
from
t1
;
drop
table
t1
,
t2
;
set
global
QUERY_CACHE_SIZE
=
0
;
storage/cassandra/ha_cassandra.h
View file @
3c8b9ed6
...
...
@@ -272,4 +272,18 @@ public:
THR_LOCK_DATA
**
store_lock
(
THD
*
thd
,
THR_LOCK_DATA
**
to
,
enum
thr_lock_type
lock_type
);
///< required
my_bool
register_query_cache_table
(
THD
*
thd
,
char
*
table_key
,
uint
key_length
,
qc_engine_callback
*
engine_callback
,
ulonglong
*
engine_data
)
{
/*
Do not put data from Cassandra tables into query cache (because there
is no way to tell whether the data in cassandra cluster has changed or
not)
*/
return
FALSE
;
}
};
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