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
c712188a
Commit
c712188a
authored
Jan 21, 2003
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge sinisa@work.mysql.com:/home/bk/mysql
into sinisa.nasamreza.org:/mnt/work/mysql sql/log.cc: Auto merged
parents
d0dc9284
fc512adf
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
82 additions
and
28 deletions
+82
-28
innobase/btr/btr0sea.c
innobase/btr/btr0sea.c
+11
-1
innobase/os/os0file.c
innobase/os/os0file.c
+19
-4
myisam/mi_create.c
myisam/mi_create.c
+1
-1
sql/ha_innobase.cc
sql/ha_innobase.cc
+10
-0
sql/net_pkg.cc
sql/net_pkg.cc
+1
-1
sql/slave.cc
sql/slave.cc
+26
-8
sql/sql_db.cc
sql/sql_db.cc
+6
-4
sql/sql_parse.cc
sql/sql_parse.cc
+8
-9
No files found.
innobase/btr/btr0sea.c
View file @
c712188a
...
...
@@ -470,6 +470,7 @@ btr_search_check_guess(
/*===================*/
/* out: TRUE if success */
btr_cur_t
*
cursor
,
/* in: guessed cursor position */
ibool
can_only_compare_to_cursor_rec
,
dtuple_t
*
tuple
,
/* in: data tuple */
ulint
mode
,
/* in: PAGE_CUR_L, PAGE_CUR_LE, PAGE_CUR_G,
or PAGE_CUR_GE */
...
...
@@ -528,6 +529,10 @@ btr_search_check_guess(
}
}
if
(
can_only_compare_to_cursor_rec
)
{
return
(
FALSE
);
}
match
=
0
;
bytes
=
0
;
...
...
@@ -632,6 +637,7 @@ btr_search_guess_on_hash(
ulint
fold
;
ulint
tuple_n_fields
;
dulint
tree_id
;
ibool
can_only_compare_to_cursor_rec
=
TRUE
;
#ifdef notdefined
btr_cur_t
cursor2
;
btr_pcur_t
pcur
;
...
...
@@ -706,6 +712,8 @@ btr_search_guess_on_hash(
goto
failure
;
}
can_only_compare_to_cursor_rec
=
FALSE
;
buf_page_dbg_add_level
(
page
,
SYNC_TREE_NODE_FROM_HASH
);
}
...
...
@@ -737,7 +745,9 @@ btr_search_guess_on_hash(
fold);
*/
}
else
{
success
=
btr_search_check_guess
(
cursor
,
tuple
,
mode
,
mtr
);
success
=
btr_search_check_guess
(
cursor
,
can_only_compare_to_cursor_rec
,
tuple
,
mode
,
mtr
);
}
if
(
!
success
)
{
...
...
innobase/os/os0file.c
View file @
c712188a
...
...
@@ -8,6 +8,7 @@ Created 10/21/1995 Heikki Tuuri
#include "os0file.h"
#include "os0sync.h"
#include "os0thread.h"
#include "ut0mem.h"
#include "srv0srv.h"
#include "fil0fil.h"
...
...
@@ -1083,6 +1084,7 @@ os_file_write(
DWORD
low
;
DWORD
high
;
ulint
i
;
ulint
n_retries
=
0
;
ut_a
((
offset
&
0xFFFFFFFF
)
==
offset
);
...
...
@@ -1091,7 +1093,7 @@ os_file_write(
ut_ad
(
file
);
ut_ad
(
buf
);
ut_ad
(
n
>
0
);
retry:
low
=
offset
;
high
=
offset_high
;
...
...
@@ -1135,6 +1137,19 @@ os_file_write(
return
(
TRUE
);
}
/* If some background file system backup tool is running, then, at
least in Windows 2000, we may get here a specific error. Let us
retry the operation 100 times, with 1 second waits. */
if
(
GetLastError
()
==
ERROR_LOCK_VIOLATION
&&
n_retries
<
100
)
{
os_thread_sleep
(
1000000
);
n_retries
++
;
goto
retry
;
}
if
(
!
os_has_said_disk_full
)
{
ut_print_timestamp
(
stderr
);
...
...
@@ -1147,7 +1162,7 @@ os_file_write(
"InnoDB: what the error number means.
\n
"
"InnoDB: Check that your OS and file system support files of this size.
\n
"
"InnoDB: Check also that the disk is not full or a disk quota exceeded.
\n
"
,
name
,
offset_high
,
offset
,
n
,
len
,
name
,
offset_high
,
offset
,
n
,
(
ulint
)
len
,
(
ulint
)
GetLastError
());
os_has_said_disk_full
=
TRUE
;
...
...
@@ -1170,13 +1185,13 @@ os_file_write(
fprintf
(
stderr
,
" InnoDB: Error: Write to file %s failed at offset %lu %lu.
\n
"
"InnoDB: %lu bytes should have been written, only %l
u
were written.
\n
"
"InnoDB: %lu bytes should have been written, only %l
d
were written.
\n
"
"InnoDB: Operating system error number %lu.
\n
"
"InnoDB: Look from section 13.2 at http://www.innodb.com/ibman.html
\n
"
"InnoDB: what the error number means or use the perror program of MySQL.
\n
"
"InnoDB: Check that your OS and file system support files of this size.
\n
"
"InnoDB: Check also that the disk is not full or a disk quota exceeded.
\n
"
,
name
,
offset_high
,
offset
,
n
,
(
ul
int
)
ret
,
name
,
offset_high
,
offset
,
n
,
(
long
int
)
ret
,
(
ulint
)
errno
);
os_has_said_disk_full
=
TRUE
;
}
...
...
myisam/mi_create.c
View file @
c712188a
...
...
@@ -447,7 +447,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
share
.
base
.
records
=
ci
->
max_rows
;
share
.
base
.
reloc
=
ci
->
reloc_rows
;
share
.
base
.
reclength
=
real_reclength
;
share
.
base
.
pack_reclength
=
reclength
+
test
(
options
&
HA_OPTION_CHECKSUM
);
;
share
.
base
.
pack_reclength
=
reclength
+
test
(
options
&
HA_OPTION_CHECKSUM
);
share
.
base
.
max_pack_length
=
pack_reclength
;
share
.
base
.
min_pack_length
=
min_pack_length
;
share
.
base
.
pack_bits
=
packed
;
...
...
sql/ha_innobase.cc
View file @
c712188a
...
...
@@ -3718,6 +3718,16 @@ ha_innobase::store_lock(
lock_type
=
TL_WRITE_ALLOW_WRITE
;
}
/* In queries of type INSERT INTO t1 SELECT ... FROM t2 ...
MySQL would use the lock TL_READ_NO_INSERT on t2, and that
would conflict with TL_WRITE_ALLOW_WRITE, blocking all inserts
to t2. Convert the lock to a normal read lock to allow
concurrent inserts to t2. */
if
(
lock_type
==
TL_READ_NO_INSERT
&&
!
thd
->
in_lock_tables
)
{
lock_type
=
TL_READ
;
}
lock
.
type
=
lock_type
;
}
...
...
sql/net_pkg.cc
View file @
c712188a
...
...
@@ -206,7 +206,7 @@ net_store_length(char *pkg, ulonglong length)
}
*
packet
++=
254
;
int8store
(
packet
,
length
);
return
(
char
*
)
packet
+
9
;
return
(
char
*
)
packet
+
8
;
}
char
*
...
...
sql/slave.cc
View file @
c712188a
...
...
@@ -22,6 +22,7 @@
#include "slave.h"
#include <thr_alarm.h>
#include <my_dir.h>
#include <assert.h>
#define RPL_LOG_NAME (glob_mi.log_file_name[0] ? glob_mi.log_file_name :\
"FIRST")
...
...
@@ -362,6 +363,7 @@ static int create_table_from_dump(THD* thd, NET* net, const char* db,
TABLE_LIST
tables
;
int
error
=
1
;
handler
*
file
;
char
*
query
;
if
(
packet_len
==
packet_error
)
{
...
...
@@ -375,15 +377,23 @@ static int create_table_from_dump(THD* thd, NET* net, const char* db,
return
1
;
}
thd
->
command
=
COM_TABLE_DUMP
;
thd
->
query
=
sql_alloc
(
packet_len
+
1
);
if
(
!
thd
->
query
)
/* Note that we should not set thd->query until the area is initalized */
if
(
!
(
query
=
sql_alloc
(
packet_len
+
1
))
)
{
sql_print_error
(
"create_table_from_dump: out of memory"
);
net_printf
(
&
thd
->
net
,
ER_GET_ERRNO
,
"Out of memory"
);
return
1
;
}
memcpy
(
thd
->
query
,
net
->
read_pos
,
packet_len
);
thd
->
query
[
packet_len
]
=
0
;
memcpy
(
query
,
net
->
read_pos
,
packet_len
);
query
[
packet_len
]
=
0
;
thd
->
query_length
=
packet_len
;
/*
We make the following lock in an attempt to ensure that the compiler will
not rearrange the code so that thd->query is set too soon
*/
VOID
(
pthread_mutex_lock
(
&
LOCK_thread_count
));
thd
->
query
=
query
;
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
));
thd
->
current_tablenr
=
0
;
thd
->
query_error
=
0
;
thd
->
net
.
no_send_ok
=
1
;
...
...
@@ -967,10 +977,11 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
thd
->
db
=
rewrite_db
((
char
*
)
qev
->
db
);
if
(
db_ok
(
thd
->
db
,
replicate_do_db
,
replicate_ignore_db
))
{
thd
->
query
=
(
char
*
)
qev
->
query
;
thd
->
query
_length
=
q_len
;
thd
->
set_time
((
time_t
)
qev
->
when
);
thd
->
current_tablenr
=
0
;
VOID
(
pthread_mutex_lock
(
&
LOCK_thread_count
));
thd
->
query
=
(
char
*
)
qev
->
query
;
thd
->
query_id
=
query_id
++
;
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
));
thd
->
last_nx_table
=
thd
->
last_nx_db
=
0
;
...
...
@@ -1008,7 +1019,9 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
else
{
// master could be inconsistent, abort and tell DBA to check/fix it
VOID
(
pthread_mutex_lock
(
&
LOCK_thread_count
));
thd
->
db
=
thd
->
query
=
0
;
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
));
thd
->
convert_set
=
0
;
close_thread_tables
(
thd
);
free_root
(
&
thd
->
mem_root
,
0
);
...
...
@@ -1017,7 +1030,9 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
}
}
thd
->
db
=
0
;
// prevent db from being freed
VOID
(
pthread_mutex_lock
(
&
LOCK_thread_count
));
thd
->
query
=
0
;
// just to be sure
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
));
// assume no convert for next query unless set explictly
thd
->
convert_set
=
0
;
close_thread_tables
(
thd
);
...
...
@@ -1059,10 +1074,11 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
Load_log_event
*
lev
=
(
Load_log_event
*
)
ev
;
init_sql_alloc
(
&
thd
->
mem_root
,
8192
,
0
);
thd
->
db
=
rewrite_db
((
char
*
)
lev
->
db
);
DBUG_ASSERT
(
thd
->
query
==
0
);
thd
->
query
=
0
;
thd
->
query_error
=
0
;
if
(
db_ok
(
thd
->
db
,
replicate_do_db
,
replicate_ignore_db
))
if
(
db_ok
(
thd
->
db
,
replicate_do_db
,
replicate_ignore_db
))
{
thd
->
set_time
((
time_t
)
lev
->
when
);
thd
->
current_tablenr
=
0
;
...
...
@@ -1490,9 +1506,11 @@ the slave thread with \"mysqladmin start-slave\". We stopped at log \
sql_print_error
(
"Slave thread exiting, replication stopped in log '%s' at \
position %s"
,
RPL_LOG_NAME
,
llstr
(
glob_mi
.
pos
,
llbuff
));
VOID
(
pthread_mutex_lock
(
&
LOCK_thread_count
));
thd
->
query
=
thd
->
db
=
0
;
// extra safety
if
(
mysql
)
mc_mysql_close
(
mysql
);
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
));
if
(
mysql
)
mc_mysql_close
(
mysql
);
thd
->
proc_info
=
"Waiting for slave mutex on exit"
;
pthread_mutex_lock
(
&
LOCK_slave
);
slave_running
=
0
;
...
...
sql/sql_db.cc
View file @
c712188a
...
...
@@ -89,9 +89,9 @@ void mysql_create_db(THD *thd, char *db, uint create_options)
}
if
(
!
thd
->
query
)
{
thd
->
query
=
path
;
thd
->
query_length
=
(
uint
)
(
strxmov
(
path
,
"create database "
,
db
,
NullS
)
-
path
);
thd
->
query
=
path
;
}
{
mysql_update_log
.
write
(
thd
,
thd
->
query
,
thd
->
query_length
);
...
...
@@ -103,8 +103,9 @@ void mysql_create_db(THD *thd, char *db, uint create_options)
}
if
(
thd
->
query
==
path
)
{
VOID
(
pthread_mutex_lock
(
&
LOCK_thread_count
));
thd
->
query
=
0
;
// just in case
thd
->
query_length
=
0
;
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
))
;
}
send_ok
(
&
thd
->
net
,
result
);
...
...
@@ -178,9 +179,9 @@ void mysql_rm_db(THD *thd,char *db,bool if_exists)
if
(
!
thd
->
query
)
{
thd
->
query
=
path
;
thd
->
query_length
=
(
uint
)
(
strxmov
(
path
,
"drop database "
,
db
,
NullS
)
-
path
);
thd
->
query
=
path
;
}
mysql_update_log
.
write
(
thd
,
thd
->
query
,
thd
->
query_length
);
if
(
mysql_bin_log
.
is_open
())
...
...
@@ -190,8 +191,9 @@ void mysql_rm_db(THD *thd,char *db,bool if_exists)
}
if
(
thd
->
query
==
path
)
{
VOID
(
pthread_mutex_lock
(
&
LOCK_thread_count
));
thd
->
query
=
0
;
// just in case
thd
->
query_length
=
0
;
VOID
(
pthread_mutex_unlock
(
&
LOCK_thread_count
))
;
}
send_ok
(
&
thd
->
net
,(
ulong
)
deleted
);
}
...
...
sql/sql_parse.cc
View file @
c712188a
...
...
@@ -691,15 +691,15 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name, int fd)
thd
->
free_list
=
0
;
thd
->
query
=
tbl_name
;
if
((
error
=
mysqld_dump_create_info
(
thd
,
table
,
-
1
)))
{
my_error
(
ER_GET_ERRNO
,
MYF
(
0
));
goto
err
;
}
if
((
error
=
mysqld_dump_create_info
(
thd
,
table
,
-
1
)))
{
my_error
(
ER_GET_ERRNO
,
MYF
(
0
));
goto
err
;
}
net_flush
(
&
thd
->
net
);
error
=
table
->
file
->
dump
(
thd
,
fd
);
if
(
error
)
my_error
(
ER_GET_ERRNO
,
MYF
(
0
));
if
(
error
)
my_error
(
ER_GET_ERRNO
,
MYF
(
0
));
err:
...
...
@@ -776,9 +776,8 @@ bool do_command(THD *thd)
*
tbl_name
++
=
0
;
memcpy
(
tbl_name
,
data
+
db_len
+
2
,
tbl_len
);
tbl_name
[
tbl_len
]
=
0
;
if
(
mysql_table_dump
(
thd
,
db
,
tbl_name
,
-
1
))
if
(
mysql_table_dump
(
thd
,
db
,
tbl_name
,
-
1
))
send_error
(
&
thd
->
net
);
// dump to NET
break
;
}
case
COM_CHANGE_USER
:
...
...
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