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
0c4e4385
Commit
0c4e4385
authored
Apr 28, 2008
by
gshchepa/uchum@host.loc
Browse files
Options
Browse Files
Download
Plain Diff
Merge host.loc:/work/bugs/5.1-bugteam-36006
into host.loc:/work/bk/5.1-bugteam
parents
ae008279
107b84f9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
70 additions
and
2 deletions
+70
-2
include/myisammrg.h
include/myisammrg.h
+1
-0
mysql-test/r/merge.result
mysql-test/r/merge.result
+16
-0
mysql-test/t/merge.test
mysql-test/t/merge.test
+16
-0
storage/myisammrg/CMakeLists.txt
storage/myisammrg/CMakeLists.txt
+1
-1
storage/myisammrg/Makefile.am
storage/myisammrg/Makefile.am
+1
-1
storage/myisammrg/ha_myisammrg.cc
storage/myisammrg/ha_myisammrg.cc
+6
-0
storage/myisammrg/ha_myisammrg.h
storage/myisammrg/ha_myisammrg.h
+2
-0
storage/myisammrg/myrg_records.c
storage/myisammrg/myrg_records.c
+27
-0
No files found.
include/myisammrg.h
View file @
0c4e4385
...
@@ -112,6 +112,7 @@ extern int myrg_reset(MYRG_INFO *info);
...
@@ -112,6 +112,7 @@ extern int myrg_reset(MYRG_INFO *info);
extern
void
myrg_extrafunc
(
MYRG_INFO
*
info
,
invalidator_by_filename
inv
);
extern
void
myrg_extrafunc
(
MYRG_INFO
*
info
,
invalidator_by_filename
inv
);
extern
ha_rows
myrg_records_in_range
(
MYRG_INFO
*
info
,
int
inx
,
extern
ha_rows
myrg_records_in_range
(
MYRG_INFO
*
info
,
int
inx
,
key_range
*
min_key
,
key_range
*
max_key
);
key_range
*
min_key
,
key_range
*
max_key
);
extern
ha_rows
myrg_records
(
MYRG_INFO
*
info
);
extern
ulonglong
myrg_position
(
MYRG_INFO
*
info
);
extern
ulonglong
myrg_position
(
MYRG_INFO
*
info
);
#ifdef __cplusplus
#ifdef __cplusplus
...
...
mysql-test/r/merge.result
View file @
0c4e4385
...
@@ -2006,3 +2006,19 @@ test.t1 optimize status OK
...
@@ -2006,3 +2006,19 @@ test.t1 optimize status OK
FLUSH TABLES m1, t1;
FLUSH TABLES m1, t1;
UNLOCK TABLES;
UNLOCK TABLES;
DROP TABLE t1, m1;
DROP TABLE t1, m1;
CREATE TABLE t1(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
CREATE TABLE t2(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
CREATE TABLE t3(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
CREATE TABLE t4(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2))
ENGINE=MRG_MYISAM UNION=(t1, t2, t3);
INSERT INTO t1 VALUES (1,1), (1,2),(1,3), (1,4);
INSERT INTO t2 VALUES (2,1), (2,2),(2,3), (2,4);
INSERT INTO t3 VALUES (3,1), (3,2),(3,3), (3,4);
EXPLAIN SELECT COUNT(*) FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
EXPLAIN SELECT COUNT(*) FROM t4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
DROP TABLE t1, t2, t3, t4;
End of 5.1 tests
mysql-test/t/merge.test
View file @
0c4e4385
...
@@ -1394,3 +1394,19 @@ FLUSH TABLES m1, t1;
...
@@ -1394,3 +1394,19 @@ FLUSH TABLES m1, t1;
UNLOCK
TABLES
;
UNLOCK
TABLES
;
DROP
TABLE
t1
,
m1
;
DROP
TABLE
t1
,
m1
;
#
# Bug#36006 - Optimizer does table scan for select count(*)
#
CREATE
TABLE
t1
(
C1
INT
,
C2
INT
,
KEY
C1
(
C1
),
KEY
C2
(
C2
))
ENGINE
=
MYISAM
;
CREATE
TABLE
t2
(
C1
INT
,
C2
INT
,
KEY
C1
(
C1
),
KEY
C2
(
C2
))
ENGINE
=
MYISAM
;
CREATE
TABLE
t3
(
C1
INT
,
C2
INT
,
KEY
C1
(
C1
),
KEY
C2
(
C2
))
ENGINE
=
MYISAM
;
CREATE
TABLE
t4
(
C1
INT
,
C2
INT
,
KEY
C1
(
C1
),
KEY
C2
(
C2
))
ENGINE
=
MRG_MYISAM
UNION
=
(
t1
,
t2
,
t3
);
INSERT
INTO
t1
VALUES
(
1
,
1
),
(
1
,
2
),(
1
,
3
),
(
1
,
4
);
INSERT
INTO
t2
VALUES
(
2
,
1
),
(
2
,
2
),(
2
,
3
),
(
2
,
4
);
INSERT
INTO
t3
VALUES
(
3
,
1
),
(
3
,
2
),(
3
,
3
),
(
3
,
4
);
EXPLAIN
SELECT
COUNT
(
*
)
FROM
t1
;
EXPLAIN
SELECT
COUNT
(
*
)
FROM
t4
;
DROP
TABLE
t1
,
t2
,
t3
,
t4
;
--
echo
End
of
5.1
tests
storage/myisammrg/CMakeLists.txt
View file @
0c4e4385
...
@@ -26,7 +26,7 @@ SET(MYISAMMRG_SOURCES myrg_close.c myrg_create.c myrg_delete.c myrg_extra.c myr
...
@@ -26,7 +26,7 @@ SET(MYISAMMRG_SOURCES myrg_close.c myrg_create.c myrg_delete.c myrg_extra.c myr
myrg_locking.c myrg_open.c myrg_panic.c myrg_queue.c myrg_range.c
myrg_locking.c myrg_open.c myrg_panic.c myrg_queue.c myrg_range.c
myrg_rfirst.c myrg_rkey.c myrg_rlast.c myrg_rnext.c myrg_rnext_same.c
myrg_rfirst.c myrg_rkey.c myrg_rlast.c myrg_rnext.c myrg_rnext_same.c
myrg_rprev.c myrg_rrnd.c myrg_rsame.c myrg_static.c myrg_update.c
myrg_rprev.c myrg_rrnd.c myrg_rsame.c myrg_static.c myrg_update.c
myrg_write.c
)
myrg_write.c
myrg_records.c
)
IF
(
NOT SOURCE_SUBLIBS
)
IF
(
NOT SOURCE_SUBLIBS
)
ADD_LIBRARY
(
myisammrg
${
MYISAMMRG_SOURCES
}
)
ADD_LIBRARY
(
myisammrg
${
MYISAMMRG_SOURCES
}
)
...
...
storage/myisammrg/Makefile.am
View file @
0c4e4385
...
@@ -35,7 +35,7 @@ libmyisammrg_a_SOURCES = myrg_open.c myrg_extra.c myrg_info.c myrg_locking.c \
...
@@ -35,7 +35,7 @@ libmyisammrg_a_SOURCES = myrg_open.c myrg_extra.c myrg_info.c myrg_locking.c \
myrg_rkey.c myrg_rfirst.c myrg_rlast.c myrg_rnext.c
\
myrg_rkey.c myrg_rfirst.c myrg_rlast.c myrg_rnext.c
\
myrg_rprev.c myrg_queue.c myrg_write.c myrg_range.c
\
myrg_rprev.c myrg_queue.c myrg_write.c myrg_range.c
\
ha_myisammrg.cc
\
ha_myisammrg.cc
\
myrg_rnext_same.c
myrg_rnext_same.c
myrg_records.c
EXTRA_DIST
=
CMakeLists.txt plug.in
EXTRA_DIST
=
CMakeLists.txt plug.in
...
...
storage/myisammrg/ha_myisammrg.cc
View file @
0c4e4385
...
@@ -1154,6 +1154,12 @@ int ha_myisammrg::check(THD* thd, HA_CHECK_OPT* check_opt)
...
@@ -1154,6 +1154,12 @@ int ha_myisammrg::check(THD* thd, HA_CHECK_OPT* check_opt)
}
}
ha_rows
ha_myisammrg
::
records
()
{
return
myrg_records
(
file
);
}
extern
int
myrg_panic
(
enum
ha_panic_function
flag
);
extern
int
myrg_panic
(
enum
ha_panic_function
flag
);
int
myisammrg_panic
(
handlerton
*
hton
,
ha_panic_function
flag
)
int
myisammrg_panic
(
handlerton
*
hton
,
ha_panic_function
flag
)
{
{
...
...
storage/myisammrg/ha_myisammrg.h
View file @
0c4e4385
...
@@ -42,6 +42,7 @@ class ha_myisammrg: public handler
...
@@ -42,6 +42,7 @@ class ha_myisammrg: public handler
HA_BINLOG_ROW_CAPABLE
|
HA_BINLOG_STMT_CAPABLE
|
HA_BINLOG_ROW_CAPABLE
|
HA_BINLOG_STMT_CAPABLE
|
HA_NULL_IN_KEY
|
HA_CAN_INDEX_BLOBS
|
HA_FILE_BASED
|
HA_NULL_IN_KEY
|
HA_CAN_INDEX_BLOBS
|
HA_FILE_BASED
|
HA_ANY_INDEX_MAY_BE_UNIQUE
|
HA_CAN_BIT_FIELD
|
HA_ANY_INDEX_MAY_BE_UNIQUE
|
HA_CAN_BIT_FIELD
|
HA_HAS_RECORDS
|
HA_NO_COPY_ON_ALTER
);
HA_NO_COPY_ON_ALTER
);
}
}
ulong
index_flags
(
uint
inx
,
uint
part
,
bool
all_parts
)
const
ulong
index_flags
(
uint
inx
,
uint
part
,
bool
all_parts
)
const
...
@@ -94,4 +95,5 @@ class ha_myisammrg: public handler
...
@@ -94,4 +95,5 @@ class ha_myisammrg: public handler
TABLE
*
table_ptr
()
{
return
table
;
}
TABLE
*
table_ptr
()
{
return
table
;
}
bool
check_if_incompatible_data
(
HA_CREATE_INFO
*
info
,
uint
table_changes
);
bool
check_if_incompatible_data
(
HA_CREATE_INFO
*
info
,
uint
table_changes
);
int
check
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
);
int
check
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
);
ha_rows
records
();
};
};
storage/myisammrg/myrg_records.c
0 → 100644
View file @
0c4e4385
/* Copyright (C) 2008 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "myrg_def.h"
ha_rows
myrg_records
(
MYRG_INFO
*
info
)
{
ha_rows
records
=
0
;
MYRG_TABLE
*
file
;
DBUG_ENTER
(
"myrg_records"
);
for
(
file
=
info
->
open_tables
;
file
!=
info
->
end_table
;
file
++
)
records
+=
file
->
table
->
s
->
state
.
state
.
records
;
DBUG_RETURN
(
records
);
}
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