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
97cf413d
Commit
97cf413d
authored
Feb 01, 2007
by
istruewing@chilla.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1-engines
into chilla.local:/home/mydev/mysql-4.1-axmrg
parents
79e099e8
a6910759
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
404 additions
and
180 deletions
+404
-180
mysql-test/r/merge.result
mysql-test/r/merge.result
+21
-1
mysql-test/t/merge.test
mysql-test/t/merge.test
+28
-1
sql/ha_myisam.cc
sql/ha_myisam.cc
+315
-176
sql/ha_myisammrg.cc
sql/ha_myisammrg.cc
+40
-2
No files found.
mysql-test/r/merge.result
View file @
97cf413d
...
@@ -770,7 +770,7 @@ CREATE TABLE t1(a INT);
...
@@ -770,7 +770,7 @@ CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(2),(1);
INSERT INTO t1 VALUES(2),(1);
CREATE TABLE t2(a INT, KEY(a)) ENGINE=MERGE UNION=(t1);
CREATE TABLE t2(a INT, KEY(a)) ENGINE=MERGE UNION=(t1);
SELECT * FROM t2 WHERE a=2;
SELECT * FROM t2 WHERE a=2;
ERROR HY000:
Got error 124 from storage engine
ERROR HY000:
Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
DROP TABLE t1, t2;
DROP TABLE t1, t2;
CREATE TABLE t1(a INT) ENGINE=MEMORY;
CREATE TABLE t1(a INT) ENGINE=MEMORY;
CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t1);
CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t1);
...
@@ -781,3 +781,23 @@ CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3);
...
@@ -781,3 +781,23 @@ CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3);
SELECT * FROM t2;
SELECT * FROM t2;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
DROP TABLE t2;
DROP TABLE t2;
CREATE TABLE t1(a INT, b TEXT);
CREATE TABLE tm1(a TEXT, b INT) ENGINE=MERGE UNION=(t1);
SELECT * FROM tm1;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
DROP TABLE t1, tm1;
CREATE TABLE t1(a SMALLINT, b SMALLINT);
CREATE TABLE tm1(a INT) ENGINE=MERGE UNION=(t1);
SELECT * FROM tm1;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
DROP TABLE t1, tm1;
CREATE TABLE t1(a SMALLINT, b SMALLINT, KEY(a, b));
CREATE TABLE tm1(a SMALLINT, b SMALLINT, KEY(a)) ENGINE=MERGE UNION=(t1);
SELECT * FROM tm1;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
DROP TABLE t1, tm1;
CREATE TABLE t1(a SMALLINT, b SMALLINT, KEY(b));
CREATE TABLE tm1(a SMALLINT, b SMALLINT, KEY(a)) ENGINE=MERGE UNION=(t1);
SELECT * FROM tm1;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
DROP TABLE t1, tm1;
mysql-test/t/merge.test
View file @
97cf413d
...
@@ -383,7 +383,7 @@ drop table t1, t2, t3;
...
@@ -383,7 +383,7 @@ drop table t1, t2, t3;
CREATE
TABLE
t1
(
a
INT
);
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
2
),(
1
);
INSERT
INTO
t1
VALUES
(
2
),(
1
);
CREATE
TABLE
t2
(
a
INT
,
KEY
(
a
))
ENGINE
=
MERGE
UNION
=
(
t1
);
CREATE
TABLE
t2
(
a
INT
,
KEY
(
a
))
ENGINE
=
MERGE
UNION
=
(
t1
);
--
error
1
030
--
error
1
168
SELECT
*
FROM
t2
WHERE
a
=
2
;
SELECT
*
FROM
t2
WHERE
a
=
2
;
DROP
TABLE
t1
,
t2
;
DROP
TABLE
t1
,
t2
;
...
@@ -401,4 +401,31 @@ CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3);
...
@@ -401,4 +401,31 @@ CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3);
SELECT
*
FROM
t2
;
SELECT
*
FROM
t2
;
DROP
TABLE
t2
;
DROP
TABLE
t2
;
#
# Underlying table definition conformance tests.
#
CREATE
TABLE
t1
(
a
INT
,
b
TEXT
);
CREATE
TABLE
tm1
(
a
TEXT
,
b
INT
)
ENGINE
=
MERGE
UNION
=
(
t1
);
--
error
1168
SELECT
*
FROM
tm1
;
DROP
TABLE
t1
,
tm1
;
CREATE
TABLE
t1
(
a
SMALLINT
,
b
SMALLINT
);
CREATE
TABLE
tm1
(
a
INT
)
ENGINE
=
MERGE
UNION
=
(
t1
);
--
error
1168
SELECT
*
FROM
tm1
;
DROP
TABLE
t1
,
tm1
;
CREATE
TABLE
t1
(
a
SMALLINT
,
b
SMALLINT
,
KEY
(
a
,
b
));
CREATE
TABLE
tm1
(
a
SMALLINT
,
b
SMALLINT
,
KEY
(
a
))
ENGINE
=
MERGE
UNION
=
(
t1
);
--
error
1168
SELECT
*
FROM
tm1
;
DROP
TABLE
t1
,
tm1
;
CREATE
TABLE
t1
(
a
SMALLINT
,
b
SMALLINT
,
KEY
(
b
));
CREATE
TABLE
tm1
(
a
SMALLINT
,
b
SMALLINT
,
KEY
(
a
))
ENGINE
=
MERGE
UNION
=
(
t1
);
--
error
1168
SELECT
*
FROM
tm1
;
DROP
TABLE
t1
,
tm1
;
# End of 4.1 tests
# End of 4.1 tests
sql/ha_myisam.cc
View file @
97cf413d
This diff is collapsed.
Click to expand it.
sql/ha_myisammrg.cc
View file @
97cf413d
...
@@ -32,6 +32,13 @@
...
@@ -32,6 +32,13 @@
** MyISAM MERGE tables
** MyISAM MERGE tables
*****************************************************************************/
*****************************************************************************/
extern
int
table2myisam
(
TABLE
*
table_arg
,
MI_KEYDEF
**
keydef_out
,
MI_COLUMNDEF
**
recinfo_out
,
uint
*
records_out
);
extern
int
check_definition
(
MI_KEYDEF
*
t1_keyinfo
,
MI_COLUMNDEF
*
t1_recinfo
,
uint
t1_keys
,
uint
t1_recs
,
MI_KEYDEF
*
t2_keyinfo
,
MI_COLUMNDEF
*
t2_recinfo
,
uint
t2_keys
,
uint
t2_recs
,
bool
strict
);
const
char
**
ha_myisammrg
::
bas_ext
()
const
const
char
**
ha_myisammrg
::
bas_ext
()
const
{
static
const
char
*
ext
[]
=
{
".MRG"
,
NullS
};
return
ext
;
}
{
static
const
char
*
ext
[]
=
{
".MRG"
,
NullS
};
return
ext
;
}
...
@@ -49,6 +56,12 @@ const char *ha_myisammrg::index_type(uint key_number)
...
@@ -49,6 +56,12 @@ const char *ha_myisammrg::index_type(uint key_number)
int
ha_myisammrg
::
open
(
const
char
*
name
,
int
mode
,
uint
test_if_locked
)
int
ha_myisammrg
::
open
(
const
char
*
name
,
int
mode
,
uint
test_if_locked
)
{
{
MI_KEYDEF
*
keyinfo
;
MI_COLUMNDEF
*
recinfo
;
MYRG_TABLE
*
u_table
;
uint
recs
;
uint
keys
=
table
->
keys
;
int
error
;
char
name_buff
[
FN_REFLEN
];
char
name_buff
[
FN_REFLEN
];
DBUG_PRINT
(
"info"
,
(
"ha_myisammrg::open"
));
DBUG_PRINT
(
"info"
,
(
"ha_myisammrg::open"
));
...
@@ -69,20 +82,45 @@ int ha_myisammrg::open(const char *name, int mode, uint test_if_locked)
...
@@ -69,20 +82,45 @@ int ha_myisammrg::open(const char *name, int mode, uint test_if_locked)
if
(
table
->
reclength
!=
mean_rec_length
&&
mean_rec_length
)
if
(
table
->
reclength
!=
mean_rec_length
&&
mean_rec_length
)
{
{
DBUG_PRINT
(
"error"
,(
"reclength: %d mean_rec_length: %
d
"
,
DBUG_PRINT
(
"error"
,(
"reclength: %d mean_rec_length: %
lu
"
,
table
->
reclength
,
mean_rec_length
));
table
->
reclength
,
mean_rec_length
));
error
=
HA_ERR_WRONG_MRG_TABLE_DEF
;
goto
err
;
goto
err
;
}
}
if
((
error
=
table2myisam
(
table
,
&
keyinfo
,
&
recinfo
,
&
recs
)))
{
/* purecov: begin inspected */
DBUG_PRINT
(
"error"
,
(
"Failed to convert TABLE object to MyISAM "
"key and column definition"
));
goto
err
;
/* purecov: end */
}
for
(
u_table
=
file
->
open_tables
;
u_table
<
file
->
end_table
;
u_table
++
)
{
if
(
check_definition
(
keyinfo
,
recinfo
,
keys
,
recs
,
u_table
->
table
->
s
->
keyinfo
,
u_table
->
table
->
s
->
rec
,
u_table
->
table
->
s
->
base
.
keys
,
u_table
->
table
->
s
->
base
.
fields
,
false
))
{
my_free
((
gptr
)
recinfo
,
MYF
(
0
));
error
=
HA_ERR_WRONG_MRG_TABLE_DEF
;
goto
err
;
}
}
my_free
((
gptr
)
recinfo
,
MYF
(
0
));
#if !defined(BIG_TABLES) || SIZEOF_OFF_T == 4
#if !defined(BIG_TABLES) || SIZEOF_OFF_T == 4
/* Merge table has more than 2G rows */
/* Merge table has more than 2G rows */
if
(
table
->
crashed
)
if
(
table
->
crashed
)
{
error
=
HA_ERR_WRONG_MRG_TABLE_DEF
;
goto
err
;
goto
err
;
}
#endif
#endif
return
(
0
);
return
(
0
);
err:
err:
myrg_close
(
file
);
myrg_close
(
file
);
file
=
0
;
file
=
0
;
return
(
my_errno
=
HA_ERR_WRONG_MRG_TABLE_DEF
);
return
(
my_errno
=
error
);
}
}
int
ha_myisammrg
::
close
(
void
)
int
ha_myisammrg
::
close
(
void
)
...
...
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