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
a6755acb
Commit
a6755acb
authored
Jul 01, 2003
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix needed to support MERGE tables in different databases
parent
6bc7b3a6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
16 deletions
+24
-16
mysql-test/r/merge.result
mysql-test/r/merge.result
+8
-4
mysql-test/t/merge.test
mysql-test/t/merge.test
+6
-4
mysys/mf_loadpath.c
mysys/mf_loadpath.c
+3
-3
mysys/my_symlink.c
mysys/my_symlink.c
+7
-5
No files found.
mysql-test/r/merge.result
View file @
a6755acb
...
...
@@ -194,7 +194,7 @@ t5 CREATE TABLE `t5` (
alter table t5 type=myisam;
drop table t5, mysqltest.t6;
drop database mysqltest;
drop table
if exists
t4,t3,t1,t2;
drop table t4,t3,t1,t2;
create table t1 (c char(10)) type=myisam;
create table t2 (c char(10)) type=myisam;
create table t3 (c char(10)) union=(t1,t2) type=merge;
...
...
@@ -540,7 +540,11 @@ a b
6 1
6 2
6 3
drop table if exists t6, t5, t4, t3, t2, t1;
insert into t1 values (99,NULL);
select * from t4 where a+0 > 90;
a b
99 1
drop table t6, t5, t4, t3, t2, t1;
CREATE TABLE t1 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) TYPE=MyISAM;
INSERT INTO t1 VALUES (1,1), (2,1);
CREATE TABLE t2 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) TYPE=MyISAM;
...
...
@@ -552,7 +556,7 @@ max(b)
select max(b) from t1 where a = 2;
max(b)
1
drop table
if exists
t3,t1,t2;
drop table t3,t1,t2;
create table t1 (a int not null);
create table t2 (a int not null);
insert into t1 values (1);
...
...
@@ -571,7 +575,7 @@ select * from t6;
a
1
2
drop table
if exists
t6, t3, t1, t2, t4, t5;
drop table t6, t3, t1, t2, t4, t5;
CREATE TABLE t1 (
fileset_id tinyint(3) unsigned NOT NULL default '0',
file_code varchar(32) NOT NULL default '',
...
...
mysql-test/t/merge.test
View file @
a6755acb
...
...
@@ -64,7 +64,7 @@ drop table t5, mysqltest.t6;
drop
database
mysqltest
;
# Because of windows, it's important that we drop the merge tables first!
drop
table
if
exists
t4
,
t3
,
t1
,
t2
;
drop
table
t4
,
t3
,
t1
,
t2
;
create
table
t1
(
c
char
(
10
))
type
=
myisam
;
create
table
t2
(
c
char
(
10
))
type
=
myisam
;
...
...
@@ -188,7 +188,9 @@ select * from t1 order by a,b;
select
*
from
t2
order
by
a
,
b
;
select
*
from
t5
order
by
a
,
b
;
select
*
from
t6
order
by
a
,
b
;
drop
table
if
exists
t6
,
t5
,
t4
,
t3
,
t2
,
t1
;
insert
into
t1
values
(
99
,
NULL
);
select
*
from
t4
where
a
+
0
>
90
;
drop
table
t6
,
t5
,
t4
,
t3
,
t2
,
t1
;
CREATE
TABLE
t1
(
a
int
(
11
)
NOT
NULL
default
'0'
,
b
int
(
11
)
NOT
NULL
default
'0'
,
PRIMARY
KEY
(
a
,
b
))
TYPE
=
MyISAM
;
INSERT
INTO
t1
VALUES
(
1
,
1
),
(
2
,
1
);
...
...
@@ -197,7 +199,7 @@ INSERT INTO t2 VALUES (1,2), (2,2);
CREATE
TABLE
t3
(
a
int
(
11
)
NOT
NULL
default
'0'
,
b
int
(
11
)
NOT
NULL
default
'0'
,
KEY
a
(
a
,
b
))
TYPE
=
MRG_MyISAM
UNION
=
(
t1
,
t2
);
select
max
(
b
)
from
t3
where
a
=
2
;
select
max
(
b
)
from
t1
where
a
=
2
;
drop
table
if
exists
t3
,
t1
,
t2
;
drop
table
t3
,
t1
,
t2
;
#
# temporary merge tables
...
...
@@ -214,7 +216,7 @@ insert into t4 values (1);
insert
into
t5
values
(
2
);
create
temporary
table
t6
(
a
int
not
null
)
TYPE
=
MERGE
UNION
=
(
t4
,
t5
);
select
*
from
t6
;
drop
table
if
exists
t6
,
t3
,
t1
,
t2
,
t4
,
t5
;
drop
table
t6
,
t3
,
t1
,
t2
,
t4
,
t5
;
#
# testing merge::records_in_range and optimizer
...
...
mysys/mf_loadpath.c
View file @
a6755acb
...
...
@@ -39,10 +39,10 @@ my_string my_load_path(my_string to, const char *path,
(
is_prefix
((
gptr
)
path
,
FN_PARENTDIR
))
||
!
own_path_prefix
)
{
if
(
!
my_getwd
(
buff
,(
uint
)
(
FN_REFLEN
-
strlen
(
path
)),
MYF
(
0
)))
VOID
(
strcat
(
buff
,
path
));
if
(
!
my_getwd
(
buff
,(
uint
)
(
FN_REFLEN
+
2
-
strlen
(
path
)),
MYF
(
0
)))
VOID
(
strcat
(
buff
,
path
+
2
));
else
VOID
(
strmov
(
buff
,
path
));
VOID
(
strmov
(
buff
,
path
));
/* Return org file name */
}
else
VOID
(
strxmov
(
buff
,
own_path_prefix
,
path
,
NullS
));
...
...
mysys/my_symlink.c
View file @
a6755acb
...
...
@@ -123,20 +123,22 @@ int my_realpath(char *to, const char *filename,
}
else
{
/* Realpath didn't work; Use original name */
/*
Realpath didn't work; Use my_load_path() which is a poor substitute
original name but will at least be able to resolve paths that starts
with '.'.
*/
DBUG_PRINT
(
"error"
,(
"realpath failed with errno: %d"
,
errno
));
my_errno
=
errno
;
if
(
MyFlags
&
MY_WME
)
my_error
(
EE_REALPATH
,
MYF
(
0
),
filename
,
my_errno
);
if
(
to
!=
filename
)
strmov
(
to
,
filename
);
my_load_path
(
to
,
filename
,
NullS
);
result
=
-
1
;
}
}
DBUG_RETURN
(
result
);
#else
if
(
to
!=
filename
)
strmov
(
to
,
filename
);
my_load_path
(
to
,
filename
,
NullS
);
return
0
;
#endif
}
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