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
be34b54e
Commit
be34b54e
authored
Apr 28, 2005
by
ingo@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/mydev/mysql-4.1-4100
into mysql.com:/home/mydev/mysql-5.0-5000
parents
b31960f7
8ccbea47
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
7 deletions
+55
-7
include/my_sys.h
include/my_sys.h
+1
-0
myisam/myisampack.c
myisam/myisampack.c
+7
-2
myisammrg/myrg_open.c
myisammrg/myrg_open.c
+1
-1
mysys/my_getwd.c
mysys/my_getwd.c
+22
-0
sql/ha_myisammrg.cc
sql/ha_myisammrg.cc
+24
-4
No files found.
include/my_sys.h
View file @
be34b54e
...
@@ -638,6 +638,7 @@ extern uint dirname_part(my_string to,const char *name);
...
@@ -638,6 +638,7 @@ extern uint dirname_part(my_string to,const char *name);
extern
uint
dirname_length
(
const
char
*
name
);
extern
uint
dirname_length
(
const
char
*
name
);
#define base_name(A) (A+dirname_length(A))
#define base_name(A) (A+dirname_length(A))
extern
int
test_if_hard_path
(
const
char
*
dir_name
);
extern
int
test_if_hard_path
(
const
char
*
dir_name
);
extern
my_bool
has_path
(
const
char
*
name
);
extern
char
*
convert_dirname
(
char
*
to
,
const
char
*
from
,
const
char
*
from_end
);
extern
char
*
convert_dirname
(
char
*
to
,
const
char
*
from
,
const
char
*
from_end
);
extern
void
to_unix_path
(
my_string
name
);
extern
void
to_unix_path
(
my_string
name
);
extern
my_string
fn_ext
(
const
char
*
name
);
extern
my_string
fn_ext
(
const
char
*
name
);
...
...
myisam/myisampack.c
View file @
be34b54e
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#define __GNU_LIBRARY__
/* Skip warnings in getopt.h */
#define __GNU_LIBRARY__
/* Skip warnings in getopt.h */
#endif
#endif
#include <my_getopt.h>
#include <my_getopt.h>
#include <assert.h>
#if INT_MAX > 32767
#if INT_MAX > 32767
#define BITS_SAVED 32
#define BITS_SAVED 32
...
@@ -1996,7 +1997,9 @@ static void write_bits (register ulong value, register uint bits)
...
@@ -1996,7 +1997,9 @@ static void write_bits (register ulong value, register uint bits)
{
{
reg3
uint
byte_buff
;
reg3
uint
byte_buff
;
bits
=
(
uint
)
-
file_buffer
.
bits
;
bits
=
(
uint
)
-
file_buffer
.
bits
;
byte_buff
=
file_buffer
.
current_byte
|
(
uint
)
(
value
>>
bits
);
DBUG_ASSERT
(
bits
<=
8
*
sizeof
(
value
));
byte_buff
=
(
file_buffer
.
current_byte
|
((
bits
!=
8
*
sizeof
(
value
))
?
(
uint
)
(
value
>>
bits
)
:
0
));
#if BITS_SAVED == 32
#if BITS_SAVED == 32
*
file_buffer
.
pos
++=
(
byte
)
(
byte_buff
>>
24
)
;
*
file_buffer
.
pos
++=
(
byte
)
(
byte_buff
>>
24
)
;
*
file_buffer
.
pos
++=
(
byte
)
(
byte_buff
>>
16
)
;
*
file_buffer
.
pos
++=
(
byte
)
(
byte_buff
>>
16
)
;
...
@@ -2004,7 +2007,9 @@ static void write_bits (register ulong value, register uint bits)
...
@@ -2004,7 +2007,9 @@ static void write_bits (register ulong value, register uint bits)
*
file_buffer
.
pos
++=
(
byte
)
(
byte_buff
>>
8
)
;
*
file_buffer
.
pos
++=
(
byte
)
(
byte_buff
>>
8
)
;
*
file_buffer
.
pos
++=
(
byte
)
byte_buff
;
*
file_buffer
.
pos
++=
(
byte
)
byte_buff
;
value
&=
(
1
<<
bits
)
-
1
;
DBUG_ASSERT
(
bits
<=
8
*
sizeof
(
ulong
));
if
(
bits
!=
8
*
sizeof
(
value
))
value
&=
(((
ulong
)
1
)
<<
bits
)
-
1
;
#if BITS_SAVED == 16
#if BITS_SAVED == 16
if
(
bits
>=
sizeof
(
uint
))
if
(
bits
>=
sizeof
(
uint
))
{
{
...
...
myisammrg/myrg_open.c
View file @
be34b54e
...
@@ -80,7 +80,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
...
@@ -80,7 +80,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
continue
;
/* Skip comments */
continue
;
/* Skip comments */
}
}
if
(
!
test_if_hard
_path
(
buff
))
if
(
!
has
_path
(
buff
))
{
{
VOID
(
strmake
(
name_buff
+
dir_length
,
buff
,
VOID
(
strmake
(
name_buff
+
dir_length
,
buff
,
sizeof
(
name_buff
)
-
1
-
dir_length
));
sizeof
(
name_buff
)
-
1
-
dir_length
));
...
...
mysys/my_getwd.c
View file @
be34b54e
...
@@ -192,3 +192,25 @@ int test_if_hard_path(register const char *dir_name)
...
@@ -192,3 +192,25 @@ int test_if_hard_path(register const char *dir_name)
return
FALSE
;
return
FALSE
;
#endif
#endif
}
/* test_if_hard_path */
}
/* test_if_hard_path */
/*
Test if a name contains an (absolute or relative) path.
SYNOPSIS
has_path()
name The name to test.
RETURN
TRUE name contains a path.
FALSE name does not contain a path.
*/
my_bool
has_path
(
const
char
*
name
)
{
return
test
(
strchr
(
name
,
FN_LIBCHAR
))
#ifdef FN_DEVCHAR
||
test
(
strchr
(
name
,
FN_DEVCHAR
))
#endif
;
}
sql/ha_myisammrg.cc
View file @
be34b54e
...
@@ -400,6 +400,7 @@ int ha_myisammrg::create(const char *name, register TABLE *form,
...
@@ -400,6 +400,7 @@ int ha_myisammrg::create(const char *name, register TABLE *form,
const
char
**
table_names
,
**
pos
;
const
char
**
table_names
,
**
pos
;
TABLE_LIST
*
tables
=
(
TABLE_LIST
*
)
create_info
->
merge_list
.
first
;
TABLE_LIST
*
tables
=
(
TABLE_LIST
*
)
create_info
->
merge_list
.
first
;
THD
*
thd
=
current_thd
;
THD
*
thd
=
current_thd
;
uint
dirlgt
=
dirname_length
(
name
);
DBUG_ENTER
(
"ha_myisammrg::create"
);
DBUG_ENTER
(
"ha_myisammrg::create"
);
if
(
!
(
table_names
=
(
const
char
**
)
if
(
!
(
table_names
=
(
const
char
**
)
...
@@ -413,10 +414,29 @@ int ha_myisammrg::create(const char *name, register TABLE *form,
...
@@ -413,10 +414,29 @@ int ha_myisammrg::create(const char *name, register TABLE *form,
tbl
=
find_temporary_table
(
thd
,
tables
->
db
,
tables
->
table_name
);
tbl
=
find_temporary_table
(
thd
,
tables
->
db
,
tables
->
table_name
);
if
(
!
tbl
)
if
(
!
tbl
)
{
{
uint
length
=
my_snprintf
(
buff
,
FN_REFLEN
,
"%s%s/%s"
,
/*
mysql_real_data_home
,
Construct the path to the MyISAM table. Try to meet two conditions:
1.) Allow to include MyISAM tables from different databases, and
2.) allow for moving DATADIR around in the file system.
The first means that we need paths in the .MRG file. The second
means that we should not have absolute paths in the .MRG file.
The best, we can do, is to use 'mysql_data_home', which is '.'
in mysqld and may be an absolute path in an embedded server.
This means that it might not be possible to move the DATADIR of
an embedded server without changing the paths in the .MRG file.
*/
uint
length
=
my_snprintf
(
buff
,
FN_REFLEN
,
"%s/%s/%s"
,
mysql_data_home
,
tables
->
db
,
tables
->
table_name
);
tables
->
db
,
tables
->
table_name
);
if
(
!
(
table_name
=
thd
->
strmake
(
buff
,
length
)))
/*
If a MyISAM table is in the same directory as the MERGE table,
we use the table name without a path. This means that the
DATADIR can easily be moved even for an embedded server as long
as the MyISAM tables are from the same database as the MERGE table.
*/
if
((
dirname_length
(
buff
)
==
dirlgt
)
&&
!
memcmp
(
buff
,
name
,
dirlgt
))
table_name
=
tables
->
real_name
;
else
if
(
!
(
table_name
=
thd
->
strmake
(
buff
,
length
)))
DBUG_RETURN
(
HA_ERR_OUT_OF_MEM
);
DBUG_RETURN
(
HA_ERR_OUT_OF_MEM
);
}
}
else
else
...
...
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