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
fe1753de
Commit
fe1753de
authored
Sep 17, 2001
by
monty@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed locking problem when using bulk insert
Fixed array overrun when using drop_db Portability fixes
parent
29510745
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
46 deletions
+64
-46
.bzrignore
.bzrignore
+8
-0
acinclude.m4
acinclude.m4
+36
-36
myisam/mi_write.c
myisam/mi_write.c
+19
-9
sql/sql_db.cc
sql/sql_db.cc
+1
-1
No files found.
.bzrignore
View file @
fe1753de
...
@@ -402,3 +402,11 @@ vio/test-ssl
...
@@ -402,3 +402,11 @@ vio/test-ssl
vio/test-sslclient
vio/test-sslclient
vio/test-sslserver
vio/test-sslserver
vio/viotest-ssl
vio/viotest-ssl
libmysqld/examples/completion_hash.cc
libmysqld/examples/completion_hash.h
libmysqld/examples/my_readline.h
libmysqld/examples/mysql.cc
libmysqld/examples/mysqltest.c
libmysqld/examples/readline.cc
libmysqld/examples/sql_string.cc
libmysqld/examples/sql_string.h
acinclude.m4
View file @
fe1753de
...
@@ -1071,42 +1071,42 @@ AC_DEFUN([MYSQL_CHECK_INNODB], [
...
@@ -1071,42 +1071,42 @@ AC_DEFUN([MYSQL_CHECK_INNODB], [
dnl Some libs are listed several times, in order for gcc to sort out
dnl Some libs are listed several times, in order for gcc to sort out
dnl circular references.
dnl circular references.
innodb_libs="\
innodb_libs="\
$(top_builddir)/innobase/usr/libusr.a\
\
$(top_builddir)/innobase/usr/libusr.a\
$(top_builddir)/innobase/odbc/libodbc.a\
\
$(top_builddir)/innobase/odbc/libodbc.a\
$(top_builddir)/innobase/srv/libsrv.a\
\
$(top_builddir)/innobase/srv/libsrv.a\
$(top_builddir)/innobase/que/libque.a\
\
$(top_builddir)/innobase/que/libque.a\
$(top_builddir)/innobase/srv/libsrv.a\
\
$(top_builddir)/innobase/srv/libsrv.a\
$(top_builddir)/innobase/dict/libdict.a\
\
$(top_builddir)/innobase/dict/libdict.a\
$(top_builddir)/innobase/ibuf/libibuf.a\
\
$(top_builddir)/innobase/ibuf/libibuf.a\
$(top_builddir)/innobase/row/librow.a\
\
$(top_builddir)/innobase/row/librow.a\
$(top_builddir)/innobase/pars/libpars.a\
\
$(top_builddir)/innobase/pars/libpars.a\
$(top_builddir)/innobase/btr/libbtr.a\
\
$(top_builddir)/innobase/btr/libbtr.a\
$(top_builddir)/innobase/trx/libtrx.a\
\
$(top_builddir)/innobase/trx/libtrx.a\
$(top_builddir)/innobase/read/libread.a\
\
$(top_builddir)/innobase/read/libread.a\
$(top_builddir)/innobase/usr/libusr.a\
\
$(top_builddir)/innobase/usr/libusr.a\
$(top_builddir)/innobase/buf/libbuf.a\
\
$(top_builddir)/innobase/buf/libbuf.a\
$(top_builddir)/innobase/ibuf/libibuf.a\
\
$(top_builddir)/innobase/ibuf/libibuf.a\
$(top_builddir)/innobase/eval/libeval.a\
\
$(top_builddir)/innobase/eval/libeval.a\
$(top_builddir)/innobase/log/liblog.a\
\
$(top_builddir)/innobase/log/liblog.a\
$(top_builddir)/innobase/fsp/libfsp.a\
\
$(top_builddir)/innobase/fsp/libfsp.a\
$(top_builddir)/innobase/fut/libfut.a\
\
$(top_builddir)/innobase/fut/libfut.a\
$(top_builddir)/innobase/fil/libfil.a\
\
$(top_builddir)/innobase/fil/libfil.a\
$(top_builddir)/innobase/lock/liblock.a\
\
$(top_builddir)/innobase/lock/liblock.a\
$(top_builddir)/innobase/mtr/libmtr.a\
\
$(top_builddir)/innobase/mtr/libmtr.a\
$(top_builddir)/innobase/page/libpage.a\
\
$(top_builddir)/innobase/page/libpage.a\
$(top_builddir)/innobase/rem/librem.a\
\
$(top_builddir)/innobase/rem/librem.a\
$(top_builddir)/innobase/thr/libthr.a\
\
$(top_builddir)/innobase/thr/libthr.a\
$(top_builddir)/innobase/com/libcom.a\
\
$(top_builddir)/innobase/com/libcom.a\
$(top_builddir)/innobase/sync/libsync.a\
\
$(top_builddir)/innobase/sync/libsync.a\
$(top_builddir)/innobase/data/libdata.a\
\
$(top_builddir)/innobase/data/libdata.a\
$(top_builddir)/innobase/mach/libmach.a\
\
$(top_builddir)/innobase/mach/libmach.a\
$(top_builddir)/innobase/ha/libha.a\
\
$(top_builddir)/innobase/ha/libha.a\
$(top_builddir)/innobase/dyn/libdyn.a\
\
$(top_builddir)/innobase/dyn/libdyn.a\
$(top_builddir)/innobase/mem/libmem.a\
\
$(top_builddir)/innobase/mem/libmem.a\
$(top_builddir)/innobase/sync/libsync.a\
\
$(top_builddir)/innobase/sync/libsync.a\
$(top_builddir)/innobase/ut/libut.a\
\
$(top_builddir)/innobase/ut/libut.a\
$(top_builddir)/innobase/os/libos.a\
\
$(top_builddir)/innobase/os/libos.a\
$(top_builddir)/innobase/ut/libut.a"
\
$(top_builddir)/innobase/ut/libut.a"
AC_CHECK_LIB(rt, aio_read, [innodb_libs="$innodb_libs -lrt"])
AC_CHECK_LIB(rt, aio_read, [innodb_libs="$innodb_libs -lrt"])
;;
;;
...
...
myisam/mi_write.c
View file @
fe1753de
...
@@ -44,11 +44,12 @@ int _mi_ck_write_btree(register MI_INFO *info, uint keynr, uchar *key,
...
@@ -44,11 +44,12 @@ int _mi_ck_write_btree(register MI_INFO *info, uint keynr, uchar *key,
int
mi_write
(
MI_INFO
*
info
,
byte
*
record
)
int
mi_write
(
MI_INFO
*
info
,
byte
*
record
)
{
{
MYISAM_SHARE
*
share
=
info
->
s
;
uint
i
;
uint
i
;
int
save_errno
;
int
save_errno
;
my_off_t
filepos
;
my_off_t
filepos
;
uchar
*
buff
;
uchar
*
buff
;
MYISAM_SHARE
*
share
=
info
->
s
;
my_bool
lock_tree
=
share
->
concurrent_insert
;
DBUG_ENTER
(
"mi_write"
);
DBUG_ENTER
(
"mi_write"
);
DBUG_PRINT
(
"enter"
,(
"isam: %d data: %d"
,
info
->
s
->
kfile
,
info
->
dfile
));
DBUG_PRINT
(
"enter"
,(
"isam: %d data: %d"
,
info
->
s
->
kfile
,
info
->
dfile
));
...
@@ -99,7 +100,10 @@ int mi_write(MI_INFO *info, byte *record)
...
@@ -99,7 +100,10 @@ int mi_write(MI_INFO *info, byte *record)
{
{
if
(((
ulonglong
)
1
<<
i
)
&
share
->
state
.
key_map
)
if
(((
ulonglong
)
1
<<
i
)
&
share
->
state
.
key_map
)
{
{
if
(
share
->
concurrent_insert
&&
!
info
->
bulk_insert
)
bool
local_lock_tree
=
(
lock_tree
&&
!
(
info
->
bulk_insert
&&
is_tree_inited
(
&
info
->
bulk_insert
[
i
])));
if
(
local_lock_tree
)
{
{
rw_wrlock
(
&
share
->
key_root_lock
[
i
]);
rw_wrlock
(
&
share
->
key_root_lock
[
i
]);
share
->
keyinfo
[
i
].
version
++
;
share
->
keyinfo
[
i
].
version
++
;
...
@@ -108,7 +112,7 @@ int mi_write(MI_INFO *info, byte *record)
...
@@ -108,7 +112,7 @@ int mi_write(MI_INFO *info, byte *record)
{
{
if
(
_mi_ft_add
(
info
,
i
,(
char
*
)
buff
,
record
,
filepos
))
if
(
_mi_ft_add
(
info
,
i
,(
char
*
)
buff
,
record
,
filepos
))
{
{
if
(
share
->
concurrent_insert
)
if
(
local_lock_tree
)
rw_unlock
(
&
share
->
key_root_lock
[
i
]);
rw_unlock
(
&
share
->
key_root_lock
[
i
]);
DBUG_PRINT
(
"error"
,(
"Got error: %d on write"
,
my_errno
));
DBUG_PRINT
(
"error"
,(
"Got error: %d on write"
,
my_errno
));
goto
err
;
goto
err
;
...
@@ -119,13 +123,13 @@ int mi_write(MI_INFO *info, byte *record)
...
@@ -119,13 +123,13 @@ int mi_write(MI_INFO *info, byte *record)
uint
key_length
=
_mi_make_key
(
info
,
i
,
buff
,
record
,
filepos
);
uint
key_length
=
_mi_make_key
(
info
,
i
,
buff
,
record
,
filepos
);
if
(
_mi_ck_write
(
info
,
i
,
buff
,
key_length
))
if
(
_mi_ck_write
(
info
,
i
,
buff
,
key_length
))
{
{
if
(
share
->
concurrent_insert
&&
!
info
->
bulk_insert
)
if
(
local_lock_tree
)
rw_unlock
(
&
share
->
key_root_lock
[
i
]);
rw_unlock
(
&
share
->
key_root_lock
[
i
]);
DBUG_PRINT
(
"error"
,(
"Got error: %d on write"
,
my_errno
));
DBUG_PRINT
(
"error"
,(
"Got error: %d on write"
,
my_errno
));
goto
err
;
goto
err
;
}
}
}
}
if
(
share
->
concurrent_insert
)
if
(
local_lock_tree
)
rw_unlock
(
&
share
->
key_root_lock
[
i
]);
rw_unlock
(
&
share
->
key_root_lock
[
i
]);
}
}
}
}
...
@@ -157,13 +161,16 @@ int mi_write(MI_INFO *info, byte *record)
...
@@ -157,13 +161,16 @@ int mi_write(MI_INFO *info, byte *record)
{
{
if
(((
ulonglong
)
1
<<
i
)
&
share
->
state
.
key_map
)
if
(((
ulonglong
)
1
<<
i
)
&
share
->
state
.
key_map
)
{
{
if
(
share
->
concurrent_insert
)
bool
local_lock_tree
=
(
lock_tree
&&
!
(
info
->
bulk_insert
&&
is_tree_inited
(
&
info
->
bulk_insert
[
i
])));
if
(
local_lock_tree
)
rw_wrlock
(
&
share
->
key_root_lock
[
i
]);
rw_wrlock
(
&
share
->
key_root_lock
[
i
]);
if
(
share
->
keyinfo
[
i
].
flag
&
HA_FULLTEXT
)
if
(
share
->
keyinfo
[
i
].
flag
&
HA_FULLTEXT
)
{
{
if
(
_mi_ft_del
(
info
,
i
,(
char
*
)
buff
,
record
,
filepos
))
if
(
_mi_ft_del
(
info
,
i
,(
char
*
)
buff
,
record
,
filepos
))
{
{
if
(
share
->
concurrent_insert
)
if
(
local_lock_tree
)
rw_unlock
(
&
share
->
key_root_lock
[
i
]);
rw_unlock
(
&
share
->
key_root_lock
[
i
]);
break
;
break
;
}
}
...
@@ -173,12 +180,12 @@ int mi_write(MI_INFO *info, byte *record)
...
@@ -173,12 +180,12 @@ int mi_write(MI_INFO *info, byte *record)
uint
key_length
=
_mi_make_key
(
info
,
i
,
buff
,
record
,
filepos
);
uint
key_length
=
_mi_make_key
(
info
,
i
,
buff
,
record
,
filepos
);
if
(
_mi_ck_delete
(
info
,
i
,
buff
,
key_length
))
if
(
_mi_ck_delete
(
info
,
i
,
buff
,
key_length
))
{
{
if
(
share
->
concurrent_insert
)
if
(
local_lock_tree
)
rw_unlock
(
&
share
->
key_root_lock
[
i
]);
rw_unlock
(
&
share
->
key_root_lock
[
i
]);
break
;
break
;
}
}
}
}
if
(
share
->
concurrent_insert
)
if
(
local_lock_tree
)
rw_unlock
(
&
share
->
key_root_lock
[
i
]);
rw_unlock
(
&
share
->
key_root_lock
[
i
]);
}
}
}
}
...
@@ -212,6 +219,7 @@ int _mi_ck_write(MI_INFO *info, uint keynr, uchar *key, uint key_length)
...
@@ -212,6 +219,7 @@ int _mi_ck_write(MI_INFO *info, uint keynr, uchar *key, uint key_length)
}
}
}
/* _mi_ck_write */
}
/* _mi_ck_write */
/**********************************************************************
/**********************************************************************
* Normal insert code *
* Normal insert code *
**********************************************************************/
**********************************************************************/
...
@@ -724,6 +732,7 @@ int _mi_ck_write_tree(register MI_INFO *info, uint keynr, uchar *key,
...
@@ -724,6 +732,7 @@ int _mi_ck_write_tree(register MI_INFO *info, uint keynr, uchar *key,
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
/* _mi_ck_write_tree */
}
/* _mi_ck_write_tree */
/* typeof(_mi_keys_compare)=qsort_cmp2 */
/* typeof(_mi_keys_compare)=qsort_cmp2 */
static
int
keys_compare
(
bulk_insert_param
*
param
,
uchar
*
key1
,
uchar
*
key2
)
static
int
keys_compare
(
bulk_insert_param
*
param
,
uchar
*
key1
,
uchar
*
key2
)
{
{
...
@@ -732,6 +741,7 @@ static int keys_compare(bulk_insert_param *param, uchar *key1, uchar *key2)
...
@@ -732,6 +741,7 @@ static int keys_compare(bulk_insert_param *param, uchar *key1, uchar *key2)
key1
,
key2
,
USE_WHOLE_KEY
,
SEARCH_SAME
,
&
not_used
);
key1
,
key2
,
USE_WHOLE_KEY
,
SEARCH_SAME
,
&
not_used
);
}
}
static
int
keys_free
(
uchar
*
key
,
TREE_FREE
mode
,
bulk_insert_param
*
param
)
static
int
keys_free
(
uchar
*
key
,
TREE_FREE
mode
,
bulk_insert_param
*
param
)
{
{
/* probably I can use info->lastkey here, but I'm not sure,
/* probably I can use info->lastkey here, but I'm not sure,
...
...
sql/sql_db.cc
View file @
fe1753de
...
@@ -246,7 +246,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
...
@@ -246,7 +246,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
/* Drop the table nicely */
/* Drop the table nicely */
*
fn_ext
(
file
->
name
)
=
0
;
// Remove extension
*
fn_ext
(
file
->
name
)
=
0
;
// Remove extension
TABLE_LIST
*
table_list
=
(
TABLE_LIST
*
)
TABLE_LIST
*
table_list
=
(
TABLE_LIST
*
)
thd
->
calloc
(
sizeof
(
*
table_list
)
+
strlen
(
db
)
+
strlen
(
file
->
name
)
+
1
);
thd
->
calloc
(
sizeof
(
*
table_list
)
+
strlen
(
db
)
+
strlen
(
file
->
name
)
+
2
);
if
(
!
table_list
)
if
(
!
table_list
)
{
{
my_dirend
(
dirp
);
my_dirend
(
dirp
);
...
...
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