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
e65b9669
Commit
e65b9669
authored
Mar 24, 2005
by
brian@zim.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collection of changes per Bar and Serg.
parent
cfcedd85
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
1245 deletions
+81
-1245
acinclude.m4
acinclude.m4
+1
-1
mysql-test/r/blackhole.result
mysql-test/r/blackhole.result
+3
-0
mysql-test/t/blackhole.test
mysql-test/t/blackhole.test
+2
-1202
sql/ha_blackhole.cc
sql/ha_blackhole.cc
+62
-38
sql/ha_blackhole.h
sql/ha_blackhole.h
+13
-4
No files found.
acinclude.m4
View file @
e65b9669
...
@@ -1525,7 +1525,7 @@ AC_DEFUN([MYSQL_CHECK_BLACKHOLEDB], [
...
@@ -1525,7 +1525,7 @@ AC_DEFUN([MYSQL_CHECK_BLACKHOLEDB], [
case "$blackholedb" in
case "$blackholedb" in
yes )
yes )
AC_DEFINE([HAVE_BLACKHOLE_DB], [1], [Builds Blackhole
DB
])
AC_DEFINE([HAVE_BLACKHOLE_DB], [1], [Builds Blackhole
Storage Engine
])
AC_MSG_RESULT([yes])
AC_MSG_RESULT([yes])
[blackholedb=yes]
[blackholedb=yes]
;;
;;
...
...
mysql-test/r/blackhole.result
View file @
e65b9669
...
@@ -20,6 +20,8 @@ fld5 char(35) DEFAULT '' NOT NULL,
...
@@ -20,6 +20,8 @@ fld5 char(35) DEFAULT '' NOT NULL,
fld6 char(4) DEFAULT '' NOT NULL,
fld6 char(4) DEFAULT '' NOT NULL,
primary key (auto)
primary key (auto)
) ENGINE=blackhole;
) ENGINE=blackhole;
INSERT INTO t2 VALUES (1192,068305,00,'Colombo','hardware','colicky','');
INSERT INTO t2 VALUES (1193,000000,00,'nondecreasing','implant','thrillingly','');
select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
fld3
fld3
select fld3 from t2 where fld3 like "%cultivation" ;
select fld3 from t2 where fld3 like "%cultivation" ;
...
@@ -81,3 +83,4 @@ Full-text indexes are called collections
...
@@ -81,3 +83,4 @@ Full-text indexes are called collections
Only MyISAM tables support collections
Only MyISAM tables support collections
select * from t1 where MATCH(a,b) AGAINST ("only");
select * from t1 where MATCH(a,b) AGAINST ("only");
a b
a b
drop table if exists t1,t2;
mysql-test/t/blackhole.test
View file @
e65b9669
This diff is collapsed.
Click to expand it.
sql/ha_blackhole.cc
View file @
e65b9669
...
@@ -47,7 +47,7 @@ int ha_blackhole::close(void)
...
@@ -47,7 +47,7 @@ int ha_blackhole::close(void)
}
}
int
ha_blackhole
::
create
(
const
char
*
name
,
TABLE
*
table_arg
,
int
ha_blackhole
::
create
(
const
char
*
name
,
TABLE
*
table_arg
,
HA_CREATE_INFO
*
create_info
)
HA_CREATE_INFO
*
create_info
)
{
{
DBUG_ENTER
(
"ha_blackhole::create"
);
DBUG_ENTER
(
"ha_blackhole::create"
);
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
...
@@ -57,12 +57,12 @@ const char *ha_blackhole::index_type(uint key_number)
...
@@ -57,12 +57,12 @@ const char *ha_blackhole::index_type(uint key_number)
{
{
DBUG_ENTER
(
"ha_blackhole::index_type"
);
DBUG_ENTER
(
"ha_blackhole::index_type"
);
DBUG_RETURN
((
table
->
key_info
[
key_number
].
flags
&
HA_FULLTEXT
)
?
DBUG_RETURN
((
table
->
key_info
[
key_number
].
flags
&
HA_FULLTEXT
)
?
"FULLTEXT"
:
"FULLTEXT"
:
(
table
->
key_info
[
key_number
].
flags
&
HA_SPATIAL
)
?
(
table
->
key_info
[
key_number
].
flags
&
HA_SPATIAL
)
?
"SPATIAL"
:
"SPATIAL"
:
(
table
->
key_info
[
key_number
].
algorithm
==
HA_KEY_ALG_RTREE
)
?
(
table
->
key_info
[
key_number
].
algorithm
==
HA_KEY_ALG_RTREE
)
?
"RTREE"
:
"RTREE"
:
"BTREE"
);
"BTREE"
);
}
}
int
ha_blackhole
::
write_row
(
byte
*
buf
)
int
ha_blackhole
::
write_row
(
byte
*
buf
)
...
@@ -88,6 +88,7 @@ int ha_blackhole::rnd_next(byte *buf)
...
@@ -88,6 +88,7 @@ int ha_blackhole::rnd_next(byte *buf)
int
ha_blackhole
::
rnd_pos
(
byte
*
buf
,
byte
*
pos
)
int
ha_blackhole
::
rnd_pos
(
byte
*
buf
,
byte
*
pos
)
{
{
DBUG_ENTER
(
"ha_blackhole::rnd_pos"
);
DBUG_ENTER
(
"ha_blackhole::rnd_pos"
);
DBUG_ASSERT
(
0
);
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
...
@@ -95,6 +96,7 @@ int ha_blackhole::rnd_pos(byte * buf, byte *pos)
...
@@ -95,6 +96,7 @@ int ha_blackhole::rnd_pos(byte * buf, byte *pos)
void
ha_blackhole
::
position
(
const
byte
*
record
)
void
ha_blackhole
::
position
(
const
byte
*
record
)
{
{
DBUG_ENTER
(
"ha_blackhole::position"
);
DBUG_ENTER
(
"ha_blackhole::position"
);
DBUG_ASSERT
(
0
);
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
...
@@ -124,41 +126,63 @@ int ha_blackhole::external_lock(THD *thd, int lock_type)
...
@@ -124,41 +126,63 @@ int ha_blackhole::external_lock(THD *thd, int lock_type)
THR_LOCK_DATA
**
ha_blackhole
::
store_lock
(
THD
*
thd
,
THR_LOCK_DATA
**
ha_blackhole
::
store_lock
(
THD
*
thd
,
THR_LOCK_DATA
**
to
,
THR_LOCK_DATA
**
to
,
enum
thr_lock_type
lock_type
)
enum
thr_lock_type
lock_type
)
{
{
if
(
lock_type
!=
TL_IGNORE
&&
lock
.
type
==
TL_UNLOCK
)
{
/*
Here is where we get into the guts of a row level lock.
If TL_UNLOCK is set
If we are not doing a LOCK TABLE or DISCARD/IMPORT
TABLESPACE, then allow multiple writers
*/
if
((
lock_type
>=
TL_WRITE_CONCURRENT_INSERT
&&
lock_type
<=
TL_WRITE
)
&&
!
thd
->
in_lock_tables
&&
!
thd
->
tablespace_op
)
lock_type
=
TL_WRITE_ALLOW_WRITE
;
/*
In queries of type INSERT INTO t1 SELECT ... FROM t2 ...
MySQL would use the lock TL_READ_NO_INSERT on t2, and that
would conflict with TL_WRITE_ALLOW_WRITE, blocking all inserts
to t2. Convert the lock to a normal read lock to allow
concurrent inserts to t2.
*/
if
(
lock_type
==
TL_READ_NO_INSERT
&&
!
thd
->
in_lock_tables
)
lock_type
=
TL_READ
;
lock
.
type
=
lock_type
;
}
*
to
++=
&
lock
;
*
to
++=
&
lock
;
return
to
;
return
to
;
}
}
int
ha_blackhole
::
index_read
(
byte
*
buf
,
const
byte
*
key
,
uint
key_len
,
enum
ha_rkey_function
find_flag
)
{
DBUG_ENTER
(
"ha_blackhole::index_read"
);
DBUG_RETURN
(
0
);
}
int
ha_blackhole
::
index_read_idx
(
byte
*
buf
,
uint
idx
,
const
byte
*
key
,
uint
key_len
,
enum
ha_rkey_function
find_flag
)
{
DBUG_ENTER
(
"ha_blackhole::index_read_idx"
);
DBUG_RETURN
(
HA_ERR_END_OF_FILE
);
}
int
ha_blackhole
::
index_read_last
(
byte
*
buf
,
const
byte
*
key
,
uint
key_len
)
{
DBUG_ENTER
(
"ha_blackhole::index_read_last"
);
DBUG_RETURN
(
HA_ERR_END_OF_FILE
);
}
int
ha_blackhole
::
index_next
(
byte
*
buf
)
{
DBUG_ENTER
(
"ha_blackhole::index_next"
);
DBUG_RETURN
(
HA_ERR_END_OF_FILE
);
}
int
ha_blackhole
::
index_prev
(
byte
*
buf
)
{
DBUG_ENTER
(
"ha_blackhole::index_prev"
);
DBUG_RETURN
(
HA_ERR_END_OF_FILE
);
}
int
ha_blackhole
::
index_first
(
byte
*
buf
)
{
DBUG_ENTER
(
"ha_blackhole::index_first"
);
DBUG_RETURN
(
HA_ERR_END_OF_FILE
);
}
int
ha_blackhole
::
index_last
(
byte
*
buf
)
{
DBUG_ENTER
(
"ha_blackhole::index_last"
);
DBUG_RETURN
(
HA_ERR_END_OF_FILE
);
}
#endif
/* HAVE_BLACKHOLE_DB */
#endif
/* HAVE_BLACKHOLE_DB */
sql/ha_blackhole.h
View file @
e65b9669
...
@@ -39,7 +39,7 @@ public:
...
@@ -39,7 +39,7 @@ public:
/*
/*
The name of the index type that will be used for display
The name of the index type that will be used for display
don't implement this method unless you really have indexes
don't implement this method unless you really have indexes
*/
*/
const
char
*
index_type
(
uint
key_number
);
const
char
*
index_type
(
uint
key_number
);
const
char
**
bas_ext
()
const
;
const
char
**
bas_ext
()
const
;
ulong
table_flags
()
const
ulong
table_flags
()
const
...
@@ -68,12 +68,21 @@ public:
...
@@ -68,12 +68,21 @@ public:
int
rnd_init
(
bool
scan
);
int
rnd_init
(
bool
scan
);
int
rnd_next
(
byte
*
buf
);
int
rnd_next
(
byte
*
buf
);
int
rnd_pos
(
byte
*
buf
,
byte
*
pos
);
int
rnd_pos
(
byte
*
buf
,
byte
*
pos
);
int
index_read
(
byte
*
buf
,
const
byte
*
key
,
uint
key_len
,
enum
ha_rkey_function
find_flag
);
int
index_read_idx
(
byte
*
buf
,
uint
idx
,
const
byte
*
key
,
uint
key_len
,
enum
ha_rkey_function
find_flag
);
int
index_read_last
(
byte
*
buf
,
const
byte
*
key
,
uint
key_len
);
int
index_next
(
byte
*
buf
);
int
index_prev
(
byte
*
buf
);
int
index_first
(
byte
*
buf
);
int
index_last
(
byte
*
buf
);
void
position
(
const
byte
*
record
);
void
position
(
const
byte
*
record
);
void
info
(
uint
flag
);
void
info
(
uint
flag
);
int
external_lock
(
THD
*
thd
,
int
lock_type
);
int
external_lock
(
THD
*
thd
,
int
lock_type
);
int
create
(
const
char
*
name
,
TABLE
*
table_arg
,
int
create
(
const
char
*
name
,
TABLE
*
table_arg
,
HA_CREATE_INFO
*
create_info
);
HA_CREATE_INFO
*
create_info
);
THR_LOCK_DATA
**
store_lock
(
THD
*
thd
,
THR_LOCK_DATA
**
store_lock
(
THD
*
thd
,
THR_LOCK_DATA
**
to
,
THR_LOCK_DATA
**
to
,
enum
thr_lock_type
lock_type
);
enum
thr_lock_type
lock_type
);
};
};
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