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
e862a42d
Commit
e862a42d
authored
Nov 10, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into pcgem.rdg.cyberkinetica.com:/usr/home/acurtis/work/bug6031
parents
e4293968
97af0a0e
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
8 deletions
+81
-8
mysql-test/r/ndb_basic.result
mysql-test/r/ndb_basic.result
+7
-0
mysql-test/t/ndb_basic.test
mysql-test/t/ndb_basic.test
+15
-0
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+1
-1
sql/handler.cc
sql/handler.cc
+56
-0
sql/handler.h
sql/handler.h
+1
-1
sql/sql_db.cc
sql/sql_db.cc
+1
-6
No files found.
mysql-test/r/ndb_basic.result
View file @
e862a42d
...
...
@@ -400,6 +400,13 @@ b attr1
9413 9412
drop table test.t1, t2;
drop database mysqltest;
drop database if exists ndbtest1;
create database ndbtest1;
use ndbtest1;
create table t1(id int) engine=ndbcluster;
drop database ndbtest1;
drop database ndbtest1;
ERROR HY000: Can't drop database 'ndbtest1'; database doesn't exist
use test;
create table t1 (a int primary key, b char(0));
insert into t1 values (1,"");
...
...
mysql-test/t/ndb_basic.test
View file @
e862a42d
...
...
@@ -360,6 +360,21 @@ select b,test.t1.attr1 from test.t1, t2 where test.t1.pk1 < a;
drop
table
test
.
t1
,
t2
;
drop
database
mysqltest
;
#
# BUG#6031 - DROP DATABASE doesn't drop database on first try
#
--
disable_warnings
drop
database
if
exists
ndbtest1
;
--
enable_warnings
create
database
ndbtest1
;
use
ndbtest1
;
create
table
t1
(
id
int
)
engine
=
ndbcluster
;
drop
database
ndbtest1
;
--
error
1008
drop
database
ndbtest1
;
#
# test support of char(0)
#
...
...
sql/ha_ndbcluster.cc
View file @
e862a42d
...
...
@@ -2777,7 +2777,7 @@ int ha_ndbcluster::reset()
const
char
**
ha_ndbcluster
::
bas_ext
()
const
{
static
const
char
*
ext
[]
=
{
".ndb"
,
NullS
};
return
ext
;
}
{
static
const
char
*
ext
[]
=
{
ha_ndb_ext
,
NullS
};
return
ext
;
}
/*
...
...
sql/handler.cc
View file @
e862a42d
...
...
@@ -109,6 +109,8 @@ const char *tx_isolation_names[] =
TYPELIB
tx_isolation_typelib
=
{
array_elements
(
tx_isolation_names
)
-
1
,
""
,
tx_isolation_names
,
NULL
};
static
TYPELIB
known_extensions
=
{
0
,
"known_exts"
,
NULL
,
NULL
};
enum
db_type
ha_resolve_by_name
(
const
char
*
name
,
uint
namelen
)
{
THD
*
thd
=
current_thd
;
...
...
@@ -1633,3 +1635,57 @@ int handler::index_read_idx(byte * buf, uint index, const byte * key,
return
error
;
}
/*
Returns a list of all known extensions.
SYNOPSIS
ha_known_exts()
NOTES
No mutexes, worst case race is a minor surplus memory allocation
RETURN VALUE
pointer pointer to TYPELIB structure
*/
TYPELIB
*
ha_known_exts
(
void
)
{
if
(
!
known_extensions
.
type_names
)
{
show_table_type_st
*
types
;
List
<
char
>
found_exts
;
List_iterator_fast
<
char
>
it
(
found_exts
);
const
char
*
e
,
**
ext
;
found_exts
.
push_back
(
".db"
);
for
(
types
=
sys_table_types
;
types
->
type
;
types
++
)
{
if
(
*
types
->
value
==
SHOW_OPTION_YES
)
{
handler
*
file
=
get_new_handler
(
0
,(
enum
db_type
)
types
->
db_type
);
for
(
ext
=
file
->
bas_ext
();
*
ext
;
ext
++
)
{
while
(
e
=
it
++
)
if
(
e
==
*
ext
)
break
;
if
(
!
e
)
found_exts
.
push_back
((
char
*
)
*
ext
);
it
.
rewind
();
}
delete
file
;
}
}
ext
=
(
const
char
**
)
my_once_alloc
(
sizeof
(
char
*
)
*
(
found_exts
.
elements
+
1
),
MYF
(
MY_WME
));
DBUG_ASSERT
(
ext
);
for
(
uint
i
=
0
;
e
=
it
++
;
i
++
)
ext
[
i
]
=
e
;
ext
[
found_exts
.
elements
]
=
0
;
known_extensions
.
count
=
found_exts
.
elements
;
known_extensions
.
type_names
=
ext
;
}
return
&
known_extensions
;
}
sql/handler.h
View file @
e862a42d
...
...
@@ -567,5 +567,5 @@ int ha_discover(THD* thd, const char* dbname, const char* name,
int
ha_find_files
(
THD
*
thd
,
const
char
*
db
,
const
char
*
path
,
const
char
*
wild
,
bool
dir
,
List
<
char
>*
files
);
int
ha_table_exists
(
THD
*
thd
,
const
char
*
db
,
const
char
*
name
);
TYPELIB
*
ha_known_exts
(
void
);
sql/sql_db.cc
View file @
e862a42d
...
...
@@ -30,11 +30,6 @@ const char *del_exts[]= {".frm", ".BAK", ".TMD",".opt", NullS};
static
TYPELIB
deletable_extentions
=
{
array_elements
(
del_exts
)
-
1
,
"del_exts"
,
del_exts
,
NULL
};
const
char
*
known_exts
[]
=
{
".ISM"
,
".ISD"
,
".ISM"
,
".MRG"
,
".MYI"
,
".MYD"
,
".db"
,
".ibd"
,
NullS
};
static
TYPELIB
known_extentions
=
{
array_elements
(
known_exts
)
-
1
,
"known_exts"
,
known_exts
,
NULL
};
static
long
mysql_rm_known_files
(
THD
*
thd
,
MY_DIR
*
dirp
,
const
char
*
db
,
const
char
*
path
,
uint
level
);
...
...
@@ -737,7 +732,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
extension
=
fn_ext
(
file
->
name
);
if
(
find_type
(
extension
,
&
deletable_extentions
,
1
+
2
)
<=
0
)
{
if
(
find_type
(
extension
,
&
known_extentions
,
1
+
2
)
<=
0
)
if
(
find_type
(
extension
,
ha_known_exts
()
,
1
+
2
)
<=
0
)
found_other_files
++
;
continue
;
}
...
...
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