Skip to content

Commit ae57a47

Browse files
author
Alexander Barkov
committed
Merging from mysql-next-mr
2 parents f1bae16 + cbb0248 commit ae57a47

File tree

257 files changed

+30323
-8013
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

257 files changed

+30323
-8013
lines changed

.bzrignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3072,6 +3072,9 @@ libmysqld/rpl_handler.cc
30723072
libmysqld/debug_sync.cc
30733073
libmysqld/rpl_handler.cc
30743074
dbug/tests
3075+
libmysqld/mdl.cc
3076+
client/transaction.h
3077+
libmysqld/transaction.cc
30753078
libmysqld/sys_vars.cc
30763079
libmysqld/keycaches.cc
30773080
client/dtoa.c

client/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ sql_src=log_event.h mysql_priv.h rpl_constants.h \
107107
rpl_tblmap.h rpl_tblmap.cc \
108108
log_event.cc my_decimal.h my_decimal.cc \
109109
log_event_old.h log_event_old.cc \
110+
rpl_record_old.h rpl_record_old.cc \
110111
rpl_utility.h rpl_utility.cc \
111-
rpl_record_old.h rpl_record_old.cc
112+
transaction.h
112113
strings_src=decimal.c dtoa.c
113114

114115
link_sources:

include/my_base.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,11 @@ enum ha_extra_function {
191191
/* Inform handler that we will do a rename */
192192
HA_EXTRA_PREPARE_FOR_RENAME,
193193
/*
194-
Orders MERGE handler to attach or detach its child tables. Used at
195-
begin and end of a statement.
194+
Special actions for MERGE tables.
196195
*/
196+
HA_EXTRA_ADD_CHILDREN_LIST,
197197
HA_EXTRA_ATTACH_CHILDREN,
198+
HA_EXTRA_IS_ATTACHED_CHILDREN,
198199
HA_EXTRA_DETACH_CHILDREN
199200
};
200201

include/my_global.h

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,7 @@ inline void operator delete[](void*, void*) { /* Do nothing */ }
15981598
#if !defined(max)
15991599
#define max(a, b) ((a) > (b) ? (a) : (b))
16001600
#define min(a, b) ((a) < (b) ? (a) : (b))
1601-
#endif
1601+
#endif
16021602
/*
16031603
Only Linux is known to need an explicit sync of the directory to make sure a
16041604
file creation/deletion/renaming in(from,to) this directory durable.
@@ -1611,6 +1611,25 @@ inline void operator delete[](void*, void*) { /* Do nothing */ }
16111611
#define bool In_C_you_should_use_my_bool_instead()
16121612
#endif
16131613

1614+
/* Provide __func__ macro definition for platforms that miss it. */
1615+
#if __STDC_VERSION__ < 199901L
1616+
# if __GNUC__ >= 2
1617+
# define __func__ __FUNCTION__
1618+
# else
1619+
# define __func__ "<unknown>"
1620+
# endif
1621+
#elif defined(_MSC_VER)
1622+
# if _MSC_VER < 1300
1623+
# define __func__ "<unknown>"
1624+
# else
1625+
# define __func__ __FUNCTION__
1626+
# endif
1627+
#elif defined(__BORLANDC__)
1628+
# define __func__ __FUNC__
1629+
#else
1630+
# define __func__ "<unknown>"
1631+
#endif
1632+
16141633
#ifndef HAVE_RINT
16151634
/**
16161635
All integers up to this number can be represented exactly as double precision

include/my_pthread.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,19 @@ struct timespec {
102102
(ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \
103103
}
104104

105+
/**
106+
Compare two timespec structs.
107+
108+
@retval 1 If TS1 ends after TS2.
109+
110+
@retval 0 If TS1 is equal to TS2.
111+
112+
@retval -1 If TS1 ends before TS2.
113+
*/
114+
#define cmp_timespec(TS1, TS2) \
115+
((TS1.tv.i64 > TS2.tv.i64) ? 1 : \
116+
((TS1.tv.i64 < TS2.tv.i64) ? -1 : 0))
117+
105118

106119
int win_pthread_mutex_trylock(pthread_mutex_t *mutex);
107120
int pthread_create(pthread_t *, const pthread_attr_t *, pthread_handler, void *);
@@ -412,6 +425,33 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
412425
(ABSTIME).tv_nsec= (long) (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
413426
}
414427
#endif /* !set_timespec_nsec */
428+
#endif /* HAVE_TIMESPEC_TS_SEC */
429+
430+
/**
431+
Compare two timespec structs.
432+
433+
@retval 1 If TS1 ends after TS2.
434+
435+
@retval 0 If TS1 is equal to TS2.
436+
437+
@retval -1 If TS1 ends before TS2.
438+
*/
439+
#ifdef HAVE_TIMESPEC_TS_SEC
440+
#ifndef cmp_timespec
441+
#define cmp_timespec(TS1, TS2) \
442+
((TS1.ts_sec > TS2.ts_sec || \
443+
(TS1.ts_sec == TS2.ts_sec && TS1.ts_nsec > TS2.ts_nsec)) ? 1 : \
444+
((TS1.ts_sec < TS2.ts_sec || \
445+
(TS1.ts_sec == TS2.ts_sec && TS1.ts_nsec < TS2.ts_nsec)) ? -1 : 0))
446+
#endif /* !cmp_timespec */
447+
#else
448+
#ifndef cmp_timespec
449+
#define cmp_timespec(TS1, TS2) \
450+
((TS1.tv_sec > TS2.tv_sec || \
451+
(TS1.tv_sec == TS2.tv_sec && TS1.tv_nsec > TS2.tv_nsec)) ? 1 : \
452+
((TS1.tv_sec < TS2.tv_sec || \
453+
(TS1.tv_sec == TS2.tv_sec && TS1.tv_nsec < TS2.tv_nsec)) ? -1 : 0))
454+
#endif /* !cmp_timespec */
415455
#endif /* HAVE_TIMESPEC_TS_SEC */
416456

417457
/* safe_mutex adds checking to mutex for easier debugging */

include/my_sys.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@ extern void (*fatal_error_handler_hook)(uint my_err, const char *str,
235235
extern uint my_file_limit;
236236
extern ulong my_thread_stack_size;
237237

238+
extern const char *(*proc_info_hook)(void *, const char *, const char *,
239+
const char *, const unsigned int);
240+
238241
#ifdef HAVE_LARGE_PAGES
239242
extern my_bool my_use_large_pages;
240243
extern uint my_large_page_size;

include/probes_mysql_nodtrace.h

Lines changed: 0 additions & 129 deletions
This file was deleted.

include/thr_lock.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ enum enum_thr_lock_result { THR_LOCK_SUCCESS= 0, THR_LOCK_ABORTED= 1,
8383

8484

8585
extern ulong max_write_lock_count;
86-
extern ulong table_lock_wait_timeout;
8786
extern my_bool thr_lock_inited;
8887
extern enum thr_lock_type thr_upgraded_concurrent_insert_lock;
8988

@@ -156,19 +155,25 @@ void thr_lock_data_init(THR_LOCK *lock,THR_LOCK_DATA *data,
156155
void *status_param);
157156
enum enum_thr_lock_result thr_lock(THR_LOCK_DATA *data,
158157
THR_LOCK_OWNER *owner,
159-
enum thr_lock_type lock_type);
158+
enum thr_lock_type lock_type,
159+
ulong lock_wait_timeout);
160160
void thr_unlock(THR_LOCK_DATA *data);
161161
enum enum_thr_lock_result thr_multi_lock(THR_LOCK_DATA **data,
162-
uint count, THR_LOCK_OWNER *owner);
162+
uint count, THR_LOCK_OWNER *owner,
163+
ulong lock_wait_timeout);
163164
void thr_multi_unlock(THR_LOCK_DATA **data,uint count);
165+
void
166+
thr_lock_merge_status(THR_LOCK_DATA **data, uint count);
164167
void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock);
165168
my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread);
166169
void thr_print_locks(void); /* For debugging */
167170
my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data,
168-
enum thr_lock_type new_lock_type);
171+
enum thr_lock_type new_lock_type,
172+
ulong lock_wait_timeout);
169173
void thr_downgrade_write_lock(THR_LOCK_DATA *data,
170174
enum thr_lock_type new_lock_type);
171-
my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data);
175+
my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data,
176+
ulong lock_wait_timeout);
172177
#ifdef __cplusplus
173178
}
174179
#endif

libmysqld/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
135135
../sql/scheduler.cc ../sql/sql_audit.cc
136136
../sql/event_parse_data.cc
137137
../sql/sql_signal.cc ../sql/rpl_handler.cc
138+
../sql/mdl.cc ../sql/transaction.cc
138139
${GEN_SOURCES}
139140
${LIB_SOURCES})
140141

libmysqld/Makefile.am

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,10 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
7575
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
7676
parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
7777
rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \
78-
debug_sync.cc \
79-
sql_tablespace.cc \
78+
debug_sync.cc sql_tablespace.cc transaction.cc \
8079
rpl_injector.cc my_user.c partition_info.cc \
81-
sql_servers.cc sql_audit.cc event_parse_data.cc \
82-
sql_signal.cc rpl_handler.cc keycaches.cc
80+
sql_servers.cc event_parse_data.cc sql_signal.cc \
81+
rpl_handler.cc mdl.cc keycaches.cc sql_audit.cc
8382

8483
libmysqld_int_a_SOURCES= $(libmysqld_sources)
8584
nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# Bug#989: If DROP TABLE while there's an active transaction, wrong binlog order
3+
#
4+
5+
--disable_warnings
6+
DROP TABLE IF EXISTS t1;
7+
--enable_warnings
8+
9+
connect (con1,localhost,root,,);
10+
connect (con2,localhost,root,,);
11+
12+
connection con1;
13+
RESET MASTER;
14+
CREATE TABLE t1 (a INT);
15+
SET AUTOCOMMIT=OFF;
16+
BEGIN;
17+
INSERT INTO t1 VALUES(1);
18+
19+
connection con2;
20+
--send DROP TABLE t1;
21+
22+
connection con1;
23+
COMMIT;
24+
25+
connection con2;
26+
--reap
27+
28+
connection default;
29+
30+
--disconnect con1
31+
--disconnect con2
32+
33+
let $VERSION=`select version()`;
34+
source include/show_binlog_events.inc;

mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ select (@after:=unix_timestamp())*0; # always give repeatable output
205205
# the bug, the reap would return immediately after the insert into t2.
206206
select (@after-@before) >= 2;
207207

208+
connection con3;
209+
commit;
210+
211+
connection con2;
208212
drop table t1,t2;
209213
commit;
210214

0 commit comments

Comments
 (0)