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
8634f7e5
Commit
8634f7e5
authored
Dec 20, 2018
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '5.5' into 10.0
parents
f16d4d4c
b0fd06a6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
56 deletions
+43
-56
cmake/zlib.cmake
cmake/zlib.cmake
+0
-5
mysql-test/r/read_only.result
mysql-test/r/read_only.result
+14
-1
mysql-test/t/read_only.test
mysql-test/t/read_only.test
+17
-4
sql/sql_parse.cc
sql/sql_parse.cc
+1
-0
unittest/mysys/lf-t.c
unittest/mysys/lf-t.c
+0
-5
unittest/mysys/my_atomic-t.c
unittest/mysys/my_atomic-t.c
+1
-16
unittest/mysys/thr_template.c
unittest/mysys/thr_template.c
+9
-22
unittest/mysys/waiting_threads-t.c
unittest/mysys/waiting_threads-t.c
+1
-3
No files found.
cmake/zlib.cmake
View file @
8634f7e5
...
...
@@ -34,11 +34,6 @@ ENDMACRO()
MACRO
(
MYSQL_CHECK_ZLIB_WITH_COMPRESS
)
# For NDBCLUSTER: Use bundled zlib by default
IF
(
NOT WITH_ZLIB
)
SET
(
WITH_ZLIB
"bundled"
CACHE STRING
"By default use bundled zlib on this platform"
)
ENDIF
()
IF
(
WITH_ZLIB STREQUAL
"bundled"
)
MYSQL_USE_BUNDLED_ZLIB
()
ELSE
()
...
...
mysql-test/r/read_only.result
View file @
8634f7e5
...
...
@@ -163,11 +163,23 @@ flush privileges;
drop database mysqltest_db1;
set global read_only= @start_read_only;
#
# MDEV-16987 - ALTER DATABASE possible in read-only mode
#
GRANT ALTER ON test1.* TO user1@localhost;
CREATE DATABASE test1;
SET GLOBAL read_only=1;
ALTER DATABASE test1 CHARACTER SET utf8;
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
SET GLOBAL read_only=0;
DROP DATABASE test1;
DROP USER user1@localhost;
USE test;
# End of 5.5 tests
#
# WL#5968 Implement START TRANSACTION READ (WRITE|ONLY);
#
#
# Test interaction with read_only system variable.
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1), (2);
CREATE USER user1;
...
...
@@ -199,3 +211,4 @@ COMMIT;
DROP USER user1;
SET GLOBAL read_only= 0;
DROP TABLE t1;
# End of 10.0 tests
mysql-test/t/read_only.test
View file @
8634f7e5
...
...
@@ -307,6 +307,22 @@ flush privileges;
drop
database
mysqltest_db1
;
set
global
read_only
=
@
start_read_only
;
--
echo
#
--
echo
# MDEV-16987 - ALTER DATABASE possible in read-only mode
--
echo
#
GRANT
ALTER
ON
test1
.*
TO
user1
@
localhost
;
CREATE
DATABASE
test1
;
SET
GLOBAL
read_only
=
1
;
change_user
user1
;
--
error
ER_OPTION_PREVENTS_STATEMENT
ALTER
DATABASE
test1
CHARACTER
SET
utf8
;
change_user
root
;
SET
GLOBAL
read_only
=
0
;
DROP
DATABASE
test1
;
DROP
USER
user1
@
localhost
;
USE
test
;
--
echo
# End of 5.5 tests
--
echo
#
--
echo
# WL#5968 Implement START TRANSACTION READ (WRITE|ONLY);
...
...
@@ -315,10 +331,6 @@ set global read_only= @start_read_only;
--
echo
#
--
echo
# Test interaction with read_only system variable.
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
),
(
2
);
...
...
@@ -369,3 +381,4 @@ DROP TABLE t1;
# Wait till all disconnects are completed
--
source
include
/
wait_until_count_sessions
.
inc
--
echo
# End of 10.0 tests
sql/sql_parse.cc
View file @
8634f7e5
...
...
@@ -1045,6 +1045,7 @@ static bool deny_updates_if_read_only_option(THD *thd, TABLE_LIST *all_tables)
DBUG_RETURN
(
FALSE
);
if
(
lex
->
sql_command
==
SQLCOM_CREATE_DB
||
lex
->
sql_command
==
SQLCOM_ALTER_DB
||
lex
->
sql_command
==
SQLCOM_DROP_DB
)
DBUG_RETURN
(
TRUE
);
...
...
unittest/mysys/lf-t.c
View file @
8634f7e5
...
...
@@ -48,9 +48,6 @@ pthread_handler_t test_lf_pinbox(void *arg)
pins
=
lf_pinbox_get_pins
(
&
lf_allocator
.
pinbox
);
}
lf_pinbox_put_pins
(
pins
);
pthread_mutex_lock
(
&
mutex
);
if
(
!--
running_threads
)
pthread_cond_signal
(
&
cond
);
pthread_mutex_unlock
(
&
mutex
);
if
(
with_my_thread_init
)
my_thread_end
();
...
...
@@ -105,7 +102,6 @@ pthread_handler_t test_lf_alloc(void *arg)
bad
|=
lf_allocator
.
mallocs
-
lf_alloc_pool_count
(
&
lf_allocator
);
#endif
}
if
(
!--
running_threads
)
pthread_cond_signal
(
&
cond
);
pthread_mutex_unlock
(
&
mutex
);
if
(
with_my_thread_init
)
...
...
@@ -159,7 +155,6 @@ pthread_handler_t test_lf_hash(void *arg)
lf_hash
.
size
,
inserts
);
bad
|=
lf_hash
.
count
;
}
if
(
!--
running_threads
)
pthread_cond_signal
(
&
cond
);
pthread_mutex_unlock
(
&
mutex
);
if
(
with_my_thread_init
)
my_thread_end
();
...
...
unittest/mysys/my_atomic-t.c
View file @
8634f7e5
...
...
@@ -35,9 +35,6 @@ pthread_handler_t test_atomic_add(void *arg)
my_atomic_add32
(
&
bad
,
-
x
);
my_atomic_rwlock_wrunlock
(
&
rwl
);
}
pthread_mutex_lock
(
&
mutex
);
if
(
!--
running_threads
)
pthread_cond_signal
(
&
cond
);
pthread_mutex_unlock
(
&
mutex
);
return
0
;
}
...
...
@@ -58,13 +55,6 @@ pthread_handler_t test_atomic_add64(void *arg)
my_atomic_add64
(
&
a64
,
-
x
);
my_atomic_rwlock_wrunlock
(
&
rwl
);
}
pthread_mutex_lock
(
&
mutex
);
if
(
!--
running_threads
)
{
bad
=
(
a64
!=
0
);
pthread_cond_signal
(
&
cond
);
}
pthread_mutex_unlock
(
&
mutex
);
return
0
;
}
...
...
@@ -108,9 +98,6 @@ pthread_handler_t test_atomic_fas(void *arg)
my_atomic_add32
(
&
bad
,
-
x
);
my_atomic_rwlock_wrunlock
(
&
rwl
);
pthread_mutex_lock
(
&
mutex
);
if
(
!--
running_threads
)
pthread_cond_signal
(
&
cond
);
pthread_mutex_unlock
(
&
mutex
);
return
0
;
}
...
...
@@ -140,9 +127,6 @@ pthread_handler_t test_atomic_cas(void *arg)
my_atomic_rwlock_wrunlock
(
&
rwl
);
}
while
(
!
ok
)
;
}
pthread_mutex_lock
(
&
mutex
);
if
(
!--
running_threads
)
pthread_cond_signal
(
&
cond
);
pthread_mutex_unlock
(
&
mutex
);
return
0
;
}
...
...
@@ -178,6 +162,7 @@ void do_tests()
}
a64
=
0
;
test_concurrently
(
"my_atomic_add64"
,
test_atomic_add64
,
THREADS
,
CYCLES
);
bad
=
(
a64
!=
0
);
my_atomic_rwlock_destroy
(
&
rwl
);
}
unittest/mysys/thr_template.c
View file @
8634f7e5
...
...
@@ -20,35 +20,34 @@
#include <tap.h>
volatile
uint32
bad
;
pthread_attr_t
thr_attr
;
pthread_mutex_t
mutex
;
pthread_cond_t
cond
;
uint
running_threads
;
void
do_tests
();
void
test_concurrently
(
const
char
*
test
,
pthread_handler
handler
,
int
n
,
int
m
)
{
pthread_t
t
;
pthread_t
*
threads
=
malloc
(
n
*
sizeof
(
pthread_t
));
int
i
;
ulonglong
now
=
my_interval_timer
();
assert
(
threads
);
bad
=
0
;
diag
(
"Testing %s with %d threads, %d iterations... "
,
test
,
n
,
m
);
for
(
running_threads
=
n
;
n
;
n
--
)
for
(
i
=
n
;
i
;
i
--
)
{
if
(
pthread_create
(
&
t
,
&
thr_attr
,
handler
,
&
m
)
!=
0
)
if
(
pthread_create
(
&
t
hreads
[
i
],
0
,
handler
,
&
m
)
!=
0
)
{
diag
(
"Could not create thread"
);
abort
();
}
}
pthread_mutex_lock
(
&
mutex
);
while
(
running_threads
)
pthread_cond_wait
(
&
cond
,
&
mutex
);
pthread_mutex_unlock
(
&
mutex
);
for
(
i
=
n
;
i
;
i
--
)
pthread_join
(
threads
[
i
],
0
);
now
=
my_interval_timer
()
-
now
;
free
(
threads
);
ok
(
!
bad
,
"tested %s in %g secs (%d)"
,
test
,
((
double
)
now
)
/
1e9
,
bad
);
}
...
...
@@ -60,9 +59,6 @@ int main(int argc __attribute__((unused)), char **argv)
DBUG_SET_INITIAL
(
argv
[
1
]);
pthread_mutex_init
(
&
mutex
,
0
);
pthread_cond_init
(
&
cond
,
0
);
pthread_attr_init
(
&
thr_attr
);
pthread_attr_setdetachstate
(
&
thr_attr
,
PTHREAD_CREATE_DETACHED
);
#ifdef MY_ATOMIC_MODE_RWLOCKS
#if defined(HPUX11) || defined(__POWERPC__)
/* showed to be very slow (scheduler-related) */
...
...
@@ -79,16 +75,7 @@ int main(int argc __attribute__((unused)), char **argv)
do_tests
();
/*
workaround until we know why it crashes randomly on some machine
(BUG#22320).
*/
#ifdef NOT_USED
sleep
(
2
);
#endif
pthread_mutex_destroy
(
&
mutex
);
pthread_cond_destroy
(
&
cond
);
pthread_attr_destroy
(
&
thr_attr
);
my_end
(
0
);
return
exit_status
();
}
...
...
unittest/mysys/waiting_threads-t.c
View file @
8634f7e5
...
...
@@ -136,10 +136,8 @@ pthread_handler_t test_wt(void *arg)
pthread_mutex_unlock
(
&
lock
);
pthread_mutex_unlock
(
&
thds
[
id
].
lock
);
wt_thd_destroy
(
&
thds
[
id
].
thd
);
if
(
!--
running_threads
)
/* now, signal when everybody is done with deinit */
pthread_cond_signal
(
&
cond
);
pthread_mutex_unlock
(
&
mutex
);
DBUG_PRINT
(
"wt"
,
(
"exiting"
));
my_thread_end
();
return
0
;
...
...
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