Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
mariadb
Commits
ae633008
Commit
ae633008
authored
13 years ago
by
Sergei Golubchik
Browse files
Options
Download
Plain Diff
merge
parents
8feff690
3e8731de
Changes
59
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
300 additions
and
65 deletions
+300
-65
.bzrignore
.bzrignore
+5
-1
CMakeLists.txt
CMakeLists.txt
+27
-21
configure.in
configure.in
+1
-1
include/mysql/plugin.h
include/mysql/plugin.h
+19
-5
libmysqld/CMakeLists.txt
libmysqld/CMakeLists.txt
+12
-15
mysql-test/include/default_mysqld.cnf
mysql-test/include/default_mysqld.cnf
+2
-0
mysql-test/r/feedback_plugin_install.result
mysql-test/r/feedback_plugin_install.result
+13
-0
mysql-test/r/feedback_plugin_load.result
mysql-test/r/feedback_plugin_load.result
+11
-0
mysql-test/r/feedback_plugin_send.result
mysql-test/r/feedback_plugin_send.result
+15
-0
mysql-test/r/trigger.result
mysql-test/r/trigger.result
+19
-0
mysql-test/t/feedback_plugin_install.opt
mysql-test/t/feedback_plugin_install.opt
+1
-0
mysql-test/t/feedback_plugin_install.test
mysql-test/t/feedback_plugin_install.test
+15
-0
mysql-test/t/feedback_plugin_load.opt
mysql-test/t/feedback_plugin_load.opt
+2
-0
mysql-test/t/feedback_plugin_load.test
mysql-test/t/feedback_plugin_load.test
+10
-0
mysql-test/t/feedback_plugin_send.test
mysql-test/t/feedback_plugin_send.test
+24
-0
mysql-test/t/fulltext_plugin.test
mysql-test/t/fulltext_plugin.test
+2
-1
mysql-test/t/trigger.test
mysql-test/t/trigger.test
+25
-0
mysys/CMakeLists.txt
mysys/CMakeLists.txt
+1
-0
mysys/my_gethwaddr.c
mysys/my_gethwaddr.c
+85
-21
plugin/feedback/CMakeLists.txt
plugin/feedback/CMakeLists.txt
+11
-0
No files found.
.bzrignore
View file @
ae633008
...
...
@@ -702,7 +702,6 @@ ma_test_recovery.output
man/*.1
maria-win.patch
maria_log.00000*
maria_log_control
merge/*.ds?
merge/*.vcproj
missing
...
...
@@ -1971,3 +1970,8 @@ libmysql/strings_def.h
libmysql_r/strings_def.h
storage/maria/aria_log_control
scripts/mytop
CPackConfig.cmake
CPackSourceConfig.cmake
win/nmake_cache.txt
*.manifest
*.resource.txt
This diff is collapsed.
Click to expand it.
CMakeLists.txt
View file @
ae633008
...
...
@@ -114,6 +114,9 @@ ENDIF(ENABLED_DEBUG_SYNC)
SET
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
-DENABLED_DEBUG_SYNC"
)
SET
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
-DENABLED_DEBUG_SYNC"
)
SET
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
-DSAFEMALLOC -DSAFE_MUTEX"
)
SET
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
-DSAFEMALLOC -DSAFE_MUTEX"
)
# in some places we use DBUG_OFF
SET
(
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
-DDBUG_OFF"
)
SET
(
CMAKE_CXX_FLAGS_RELWITHDEBINFO
"
${
CMAKE_CXX_FLAGS_RELWITHDEBINFO
}
-DDBUG_OFF"
)
...
...
@@ -247,16 +250,15 @@ IF(WITHOUT_DYNAMIC_PLUGINS)
MESSAGE
(
"Dynamic plugins are disabled."
)
ENDIF
(
WITHOUT_DYNAMIC_PLUGINS
)
FILE
(
GLOB STORAGE_SUBDIRS storage/*
)
FILE
(
GLOB STORAGE_SUBDIRS storage/*
plugin/*
)
FOREACH
(
SUBDIR
${
STORAGE_SUBDIRS
}
)
FILE
(
RELATIVE_PATH DIRNAME
${
PROJECT_SOURCE_DIR
}
/storage
${
SUBDIR
}
)
IF
(
EXISTS
${
SUBDIR
}
/CMakeLists.txt
)
# Check MYSQL_STORAGE_ENGINE macro is present
FILE
(
STRINGS
${
SUBDIR
}
/CMakeLists.txt HAVE_STORAGE_ENGINE REGEX MYSQL_STORAGE_ENGINE
)
FILE
(
STRINGS
${
SUBDIR
}
/CMakeLists.txt HAVE_STORAGE_ENGINE REGEX
"
MYSQL_
(
STORAGE_ENGINE
|PLUGIN)"
)
IF
(
HAVE_STORAGE_ENGINE
)
# Extract name of engine from HAVE_STORAGE_ENGINE
STRING
(
REGEX REPLACE
".*MYSQL_STORAGE_ENGINE
\\
((.*
\)\\
).*"
"
\\
1
"
ENGINE_NAME
${
HAVE_STORAGE_ENGINE
}
)
STRING
(
REGEX REPLACE
".*MYSQL_
(
STORAGE_ENGINE
|PLUGIN)
\\
((.*
\)\\
).*"
"
\\
2
"
ENGINE_NAME
${
HAVE_STORAGE_ENGINE
}
)
STRING
(
TOUPPER
${
ENGINE_NAME
}
ENGINE
)
STRING
(
TOLOWER
${
ENGINE_NAME
}
ENGINE_LOWER
)
...
...
@@ -265,21 +267,23 @@ FOREACH(SUBDIR ${STORAGE_SUBDIRS})
# build as shared library (dynamic).
IF
(
EXISTS
${
SUBDIR
}
/plug.in
)
FILE
(
READ
${
SUBDIR
}
/plug.in PLUGIN_FILE_CONTENT
)
STRING
(
REGEX MATCH
"MYSQL_PLUGIN_DYNAMIC"
MYSQL_PLUGIN_DYNAMIC
${
PLUGIN_FILE_CONTENT
}
)
IF
(
PLUGIN_FILE_CONTENT MATCHES
"MYSQL_PLUGIN_DYNAMIC
\\
(
${
ENGINE_LOWER
}
"
)
STRING
(
REGEX REPLACE
".*MYSQL_PLUGIN_DYNAMIC
\\
(
${
ENGINE_LOWER
}
,[
\\
t]*
\\
[?([a-zA-Z0-9_]+/)*([a-zA-Z0-9_]+).*"
"
\\
2"
MYSQL_PLUGIN_DYNAMIC
${
PLUGIN_FILE_CONTENT
}
)
ELSE
(
PLUGIN_FILE_CONTENT MATCHES
"MYSQL_PLUGIN_DYNAMIC
\\
(
${
ENGINE_LOWER
}
"
)
SET
(
MYSQL_PLUGIN_DYNAMIC
""
)
ENDIF
(
PLUGIN_FILE_CONTENT MATCHES
"MYSQL_PLUGIN_DYNAMIC
\\
(
${
ENGINE_LOWER
}
"
)
IF
(
PLUGIN_FILE_CONTENT MATCHES
"MYSQL_PLUGIN_STATIC
\\
(
${
ENGINE_LOWER
}
"
)
STRING
(
REGEX REPLACE
".*MYSQL_PLUGIN_STATIC
\\
(
${
ENGINE_LOWER
}
,[
\\
t]*
\\
[?([a-zA-Z0-9_]+/)*([a-zA-Z0-9_]+).*"
"
\\
2"
MYSQL_PLUGIN_STATIC
${
PLUGIN_FILE_CONTENT
}
)
ELSE
(
PLUGIN_FILE_CONTENT MATCHES
"MYSQL_PLUGIN_STATIC
\\
(
${
ENGINE_LOWER
}
"
)
SET
(
MYSQL_PLUGIN_STATIC
""
)
ENDIF
(
PLUGIN_FILE_CONTENT MATCHES
"MYSQL_PLUGIN_STATIC
\\
(
${
ENGINE_LOWER
}
"
)
STRING
(
REGEX MATCH
"MYSQL_PLUGIN_MANDATORY"
MYSQL_PLUGIN_MANDATORY
${
PLUGIN_FILE_CONTENT
}
)
STRING
(
REGEX MATCH
"MYSQL_PLUGIN_STATIC"
MYSQL_PLUGIN_STATIC
${
PLUGIN_FILE_CONTENT
}
)
#
# XTRADB is located in storage/xtradb, but it says everywhere it is 'innobase' (e.g.
# it declares 'builtin_innobase_plugin', not builtin_xtradb_plugin).
# Extract the intended plugin name from MYSQL_STORAGE_ENGINE definition and use it
# where appropriate.
STRING
(
REGEX MATCH
"MYSQL_STORAGE_ENGINE.[a-z]*"
PLUGIN_NAME
${
PLUGIN_FILE_CONTENT
}
)
STRING
(
REGEX REPLACE
"MYSQL_STORAGE_ENGINE.(.*)"
"
\\
1"
PLUGIN_NAME
${
PLUGIN_NAME
}
)
# Also remember this "xtradb"/"innobase" name discrepancy for libmysqld/CMakeLists.txt:
SET
(
plugin_dir_
${
PLUGIN_NAME
}
${
DIRNAME
}
)
IF
(
MYSQL_PLUGIN_MANDATORY
)
SET
(
WITH_
${
ENGINE
}
_STORAGE_ENGINE TRUE
)
ENDIF
(
MYSQL_PLUGIN_MANDATORY
)
...
...
@@ -293,15 +297,17 @@ FOREACH(SUBDIR ${STORAGE_SUBDIRS})
ENDIF
(
WITH_
${
ENGINE
}
_STORAGE_ENGINE AND MYSQL_PLUGIN_STATIC
)
IF
(
ENGINE_BUILD_TYPE STREQUAL
"STATIC"
)
SET
(
maria_plugin_defs
"
${
maria_plugin_defs
}
,builtin_maria_
${
PLUGIN_NAME
}
_plugin"
)
SET
(
MYSQLD_STATIC_ENGINE_LIBS
${
MYSQLD_STATIC_ENGINE_LIBS
}
${
PLUGIN_NAME
}
)
SET
(
maria_plugin_defs
"
${
maria_plugin_defs
}
,builtin_maria_
${
ENGINE_LOWER
}
_plugin"
)
SET
(
MYSQLD_STATIC_ENGINE_LIBS
${
MYSQLD_STATIC_ENGINE_LIBS
}
${
MYSQL_PLUGIN_STATIC
}
)
SET
(
MYSQLD_STATIC_ENGINES
${
MYSQLD_STATIC_ENGINES
}
${
ENGINE
}
)
SET
(
STORAGE_ENGINE_DEFS
"
${
STORAGE_ENGINE_DEFS
}
-DWITH_
${
ENGINE
}
_STORAGE_ENGINE"
)
SET
(
WITH_
${
ENGINE
}
_STORAGE_ENGINE TRUE
)
SET
(
${
ENGINE
}
_DIR
${
DIR
NAME
}
)
SET
(
${
ENGINE
}
_DIR
${
SUB
DIR
}
)
ENDIF
(
ENGINE_BUILD_TYPE STREQUAL
"STATIC"
)
ENDIF
(
EXISTS
${
SUBDIR
}
/plug.in
)
IF
(
NOT ENGINE_BUILD_TYPE STREQUAL
"NONE"
)
SET
(
${
ENGINE
}
_LIB
${
MYSQL_PLUGIN_
${
ENGINE_BUILD_TYPE
}}
)
LIST
(
APPEND
${
ENGINE_BUILD_TYPE
}
_ENGINE_DIRECTORIES
${
SUBDIR
}
)
ENDIF
(
NOT ENGINE_BUILD_TYPE STREQUAL
"NONE"
)
...
...
This diff is collapsed.
Click to expand it.
configure.in
View file @
ae633008
...
...
@@ -870,7 +870,7 @@ AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS
(
fcntl.h fenv.h float.h floatingpoint.h fpu_control.h
\
ieeefp.h limits.h memory.h pwd.h
select
.h fnmatch.h
\
stdlib.h stddef.h sys/stat.h
\
stdlib.h stddef.h sys/stat.h
sys/sockio.h
\
strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h
\
sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h
\
unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h
\
...
...
This diff is collapsed.
Click to expand it.
include/mysql/plugin.h
View file @
ae633008
...
...
@@ -17,13 +17,27 @@
#ifndef _my_plugin_h
#define _my_plugin_h
/*
On Windows, exports from DLL need to be declared
*/
#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN))
#define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport)
#else
Also, plugin needs to be declared as extern "C" because MSVC
unlike other compilers, uses C++ mangling for variables not only
for functions.
*/
#if defined(_MSC_VER)
#if defined(MYSQL_DYNAMIC_PLUGIN)
#ifdef __cplusplus
#define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport)
#else
#define MYSQL_PLUGIN_EXPORT __declspec(dllexport)
#endif
#else
/* MYSQL_DYNAMIC_PLUGIN */
#ifdef __cplusplus
#define MYSQL_PLUGIN_EXPORT extern "C"
#else
#define MYSQL_PLUGIN_EXPORT
#endif
#endif
/*MYSQL_DYNAMIC_PLUGIN */
#else
/*_MSC_VER */
#define MYSQL_PLUGIN_EXPORT
#endif
...
...
This diff is collapsed.
Click to expand it.
libmysqld/CMakeLists.txt
View file @
ae633008
...
...
@@ -86,15 +86,13 @@ FOREACH(rpath ${VIO_SOURCES})
SET
(
LIB_SOURCES
${
LIB_SOURCES
}
../vio/
${
rpath
}
)
ENDFOREACH
(
rpath
)
FOREACH
(
ENGINE_LIB
${
MYSQLD_STATIC_ENGINE_LIBS
}
)
INCLUDE
(
${
CMAKE_SOURCE_DIR
}
/storage/
${
plugin_dir_
${
ENGINE_LIB
}}
/CMakeLists.txt
)
STRING
(
TOUPPER
${
ENGINE_LIB
}
ENGINE_LIB_UPPER
)
SET
(
ENGINE_DIR
${${
ENGINE_LIB_UPPER
}
_DIR
}
)
INCLUDE
(
${
CMAKE_SOURCE_DIR
}
/storage/
${
ENGINE_DIR
}
/CMakeLists.txt
)
FOREACH
(
rpath
${${
ENGINE_LIB_UPPER
}
_SOURCES
}
)
SET
(
LIB_SOURCES
${
LIB_SOURCES
}
${
CMAKE_SOURCE_DIR
}
/storage/
${
ENGINE_DIR
}
/
${
rpath
}
)
SET
(
ENGINE_BUILD_TYPE
"STATIC"
)
FOREACH
(
ENGINE
${
MYSQLD_STATIC_ENGINES
}
)
INCLUDE
(
${${
ENGINE
}
_DIR
}
/CMakeLists.txt
)
FOREACH
(
rpath
${${
ENGINE
}
_SOURCES
}
)
SET
(
LIB_SOURCES
${
LIB_SOURCES
}
${${
ENGINE
}
_DIR
}
/
${
rpath
}
)
ENDFOREACH
(
rpath
)
ENDFOREACH
(
ENGINE
_LIB
)
ENDFOREACH
(
ENGINE
)
SET
(
SOURCE_SUBLIBS FALSE
)
...
...
@@ -168,15 +166,14 @@ IF(MSVC AND CMAKE_SIZEOF_VOID_P MATCHES 8)
ENDIF
()
# Add any additional libraries requested by engine(s)
FOREACH
(
ENGINE_LIB
${
MYSQLD_STATIC_ENGINE_LIBS
}
)
STRING
(
TOUPPER
${
ENGINE_LIB
}
ENGINE_LIB_UPPER
)
IF
(
${
ENGINE_LIB_UPPER
}
_LIBS
)
TARGET_LINK_LIBRARIES
(
mysqlserver
${${
ENGINE_LIB_UPPER
}
_LIBS
}
)
ENDIF
(
${
ENGINE_LIB_UPPER
}
_LIBS
)
ENDFOREACH
(
ENGINE_LIB
)
FOREACH
(
ENGINE
${
MYSQLD_STATIC_ENGINES
}
)
IF
(
${
ENGINE
}
_LIBS
)
TARGET_LINK_LIBRARIES
(
mysqlserver
${${
ENGINE
}
_LIBS
}
)
ENDIF
(
${
ENGINE
}
_LIBS
)
ENDFOREACH
(
ENGINE
)
ADD_LIBRARY
(
libmysqld SHARED cmake_dummy.c libmysqld.def
)
ADD_DEPENDENCIES
(
libmysqld mysqlserver
)
TARGET_LINK_LIBRARIES
(
libmysqld mysqlserver wsock32
)
TARGET_LINK_LIBRARIES
(
libmysqld mysqlserver wsock32
iphlpapi
)
MYSQL_INSTALL_TARGETS
(
mysqlserver libmysqld DESTINATION lib COMPONENT Embedded
)
This diff is collapsed.
Click to expand it.
mysql-test/include/default_mysqld.cnf
View file @
ae633008
...
...
@@ -15,6 +15,8 @@ max_heap_table_size= 1M
loose-skip-innodb
loose-skip-pbxt
loose-skip-feedback
loose-feedback-user-info= mysql-test
loose-innodb_data_file_path= ibdata1:10M:autoextend
...
...
This diff is collapsed.
Click to expand it.
mysql-test/r/feedback_plugin_install.result
0 → 100644
View file @
ae633008
install plugin feedback soname 'feedback.so';
select plugin_status from information_schema.plugins where plugin_name='feedback';
plugin_status
ACTIVE
select * from information_schema.feedback where variable_name like 'feed%'
and variable_name not like '%_uid';
VARIABLE_NAME VARIABLE_VALUE
FEEDBACK 1.0
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
FEEDBACK_URL http://mariadb.org/feedback_plugin/post
FEEDBACK_USER_INFO mysql-test
uninstall plugin feedback;
This diff is collapsed.
Click to expand it.
mysql-test/r/feedback_plugin_load.result
0 → 100644
View file @
ae633008
select plugin_status from information_schema.plugins where plugin_name='feedback';
plugin_status
ACTIVE
select * from information_schema.feedback where variable_name like 'feed%'
and variable_name not like '%_uid';
VARIABLE_NAME VARIABLE_VALUE
FEEDBACK 1.0
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
FEEDBACK_URL http://mariadb.org/feedback_plugin/post
FEEDBACK_USER_INFO mysql-test
This diff is collapsed.
Click to expand it.
mysql-test/r/feedback_plugin_send.result
0 → 100644
View file @
ae633008
select plugin_status from information_schema.plugins where plugin_name='feedback';
plugin_status
ACTIVE
select * from information_schema.feedback where variable_name like 'feed%'
and variable_name not like '%_uid';
VARIABLE_NAME VARIABLE_VALUE
FEEDBACK 1.0
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
FEEDBACK_URL http://mariadb.org/feedback_plugin/post
FEEDBACK_USER_INFO mysql-test
feedback plugin: report to 'http://mariadb.org/feedback_plugin/post' was sent
feedback plugin: server replied 'ok'
feedback plugin: report to 'http://mariadb.org/feedback_plugin/post' was sent
feedback plugin: server replied 'ok'
This diff is collapsed.
Click to expand it.
mysql-test/r/trigger.result
View file @
ae633008
...
...
@@ -2117,3 +2117,22 @@ b
DROP DATABASE db1;
USE test;
End of 5.1 tests.
create table t1 (i int);
create table t2 (i int);
flush tables;
flush status;
CREATE DEFINER=`root`@`localhost` TRIGGER trg AFTER DELETE ON t1 FOR EACH ROW BEGIN DELETE FROM t2 WHERE t2.i = OLD.i; END //
insert into t1 values (1),(2);
insert into t2 values (1),(2);
delete from t1 where i=1;
show status like 'Opened_tables';
Variable_name Value
Opened_tables 3
select * from t1;
i
2
select * from t2;
i
2
drop table t1,t2;
End of 5.2 tests.
This diff is collapsed.
Click to expand it.
mysql-test/t/feedback_plugin_install.opt
0 → 100644
View file @
ae633008
--loose-feedback
This diff is collapsed.
Click to expand it.
mysql-test/t/feedback_plugin_install.test
0 → 100644
View file @
ae633008
--
source
include
/
not_embedded
.
inc
if
(
`select length('$FEEDBACK_SO') = 0`
)
{
skip
No
feedback
plugin
;
}
--
replace_regex
/
\
.
dll
/.
so
/
eval
install
plugin
feedback
soname
'$FEEDBACK_SO'
;
select
plugin_status
from
information_schema
.
plugins
where
plugin_name
=
'feedback'
;
--
replace_result
https
http
--
sorted_result
select
*
from
information_schema
.
feedback
where
variable_name
like
'feed%'
and
variable_name
not
like
'%_uid'
;
uninstall
plugin
feedback
;
This diff is collapsed.
Click to expand it.
mysql-test/t/feedback_plugin_load.opt
0 → 100644
View file @
ae633008
--loose-feedback
--plugin-load=$FEEDBACK_SO
This diff is collapsed.
Click to expand it.
mysql-test/t/feedback_plugin_load.test
0 → 100644
View file @
ae633008
if
(
`select count(*) = 0 from information_schema.plugins where plugin_name = 'feedback' and plugin_status='active'`
)
{
--
skip
Feedback
plugin
is
not
active
}
select
plugin_status
from
information_schema
.
plugins
where
plugin_name
=
'feedback'
;
--
replace_result
https
http
--
sorted_result
select
*
from
information_schema
.
feedback
where
variable_name
like
'feed%'
and
variable_name
not
like
'%_uid'
;
This diff is collapsed.
Click to expand it.
mysql-test/t/feedback_plugin_send.test
0 → 100644
View file @
ae633008
source
t
/
feedback_plugin_load
.
test
;
source
include
/
big_test
.
inc
;
if
(
!
$MTR_FEEDBACK_PLUGIN
)
{
skip
MTR_FEEDBACK_PLUGIN
is
not
set
;
}
#
# Yep. The plugin waits 5 minutes before sending anything,
# and there's no way to force it to send anything sooner.
# Let's wait, and hope that mtr is started with --parallel and
# is doing some work in other workers.
#
sleep
310
;
source
include
/
restart_mysqld
.
inc
;
replace_result
https
http
;
perl
;
$log_error
=
$ENV
{
'MYSQLTEST_VARDIR'
}
.
'/log/mysqld.1.err'
;
open
(
LOG
,
'<'
,
$log_error
)
or
die
"open(<
$log_error
): $!"
;
/
feedback
plugin
:.*/
&&
print
"$&
\n
"
while
$_
=<
LOG
>
;
close
LOG
;
EOF
This diff is collapsed.
Click to expand it.
mysql-test/t/fulltext_plugin.test
View file @
ae633008
...
...
@@ -3,7 +3,8 @@
#
# BUG#39746 - Debug flag breaks struct definition (server crash)
#
INSTALL
PLUGIN
simple_parser
SONAME
'mypluglib.so'
;
--
replace_result
.
dll
.
so
eval
INSTALL
PLUGIN
simple_parser
SONAME
'$MYPLUGLIB_SO'
;
CREATE
TABLE
t1
(
a
TEXT
,
b
TEXT
,
FULLTEXT
(
a
)
WITH
PARSER
simple_parser
);
ALTER
TABLE
t1
ADD
FULLTEXT
(
b
)
WITH
PARSER
simple_parser
;
DROP
TABLE
t1
;
...
...
This diff is collapsed.
Click to expand it.
mysql-test/t/trigger.test
View file @
ae633008
...
...
@@ -2409,3 +2409,28 @@ DROP DATABASE db1;
USE
test
;
--
echo
End
of
5.1
tests
.
#
# Test that using a trigger will not open mysql.proc
#
create
table
t1
(
i
int
);
create
table
t2
(
i
int
);
flush
tables
;
flush
status
;
delimiter
//;
CREATE
DEFINER
=
`root`
@
`localhost`
TRIGGER
trg
AFTER
DELETE
ON
t1
FOR
EACH
ROW
BEGIN
DELETE
FROM
t2
WHERE
t2
.
i
=
OLD
.
i
;
END
//
delimiter
;
//
insert
into
t1
values
(
1
),(
2
);
insert
into
t2
values
(
1
),(
2
);
delete
from
t1
where
i
=
1
;
#
# If mysql.proc would be used we would have 4 here. 3 is the correct number.
# (CREATE TRIGGER will open t1 and then flush it)
#
show
status
like
'Opened_tables'
;
select
*
from
t1
;
select
*
from
t2
;
drop
table
t1
,
t2
;
--
echo
End
of
5.2
tests
.
This diff is collapsed.
Click to expand it.
mysys/CMakeLists.txt
View file @
ae633008
...
...
@@ -48,4 +48,5 @@ SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c default_
IF
(
NOT SOURCE_SUBLIBS
)
ADD_LIBRARY
(
mysys
${
MYSYS_SOURCES
}
)
TARGET_LINK_LIBRARIES
(
mysys IPHLPAPI
)
ENDIF
(
NOT SOURCE_SUBLIBS
)
This diff is collapsed.
Click to expand it.
mysys/my_gethwaddr.c
View file @
ae633008
...
...
@@ -16,11 +16,22 @@
/* get hardware address for an interface */
/* if there are many available, any non-zero one can be used */
#define DONT_DEFINE_VOID
/* windows includes break if we do */
#include "mysys_priv.h"
#include <m_string.h>
#ifndef MAIN
static
my_bool
memcpy_and_test
(
uchar
*
to
,
uchar
*
from
,
uint
len
)
{
uint
i
,
res
=
1
;
for
(
i
=
0
;
i
<
len
;
i
++
)
if
((
*
to
++=
*
from
++
))
res
=
0
;
return
res
;
}
#ifdef __FreeBSD__
#include <net/ethernet.h>
...
...
@@ -32,11 +43,10 @@
my_bool
my_gethwaddr
(
uchar
*
to
)
{
size_t
len
;
char
*
buf
,
*
next
,
*
end
;
u
char
*
buf
,
*
next
,
*
end
,
*
addr
;
struct
if_msghdr
*
ifm
;
struct
sockaddr_dl
*
sdl
;
int
res
=
1
,
mib
[
6
]
=
{
CTL_NET
,
AF_ROUTE
,
0
,
AF_LINK
,
NET_RT_IFLIST
,
0
};
char
zero_array
[
ETHER_ADDR_LEN
]
=
{
0
};
int
res
=
1
,
mib
[
6
]
=
{
CTL_NET
,
AF_ROUTE
,
0
,
AF_LINK
,
NET_RT_IFLIST
,
0
};
if
(
sysctl
(
mib
,
6
,
NULL
,
&
len
,
NULL
,
0
)
==
-
1
)
goto
err
;
...
...
@@ -52,9 +62,9 @@ my_bool my_gethwaddr(uchar *to)
ifm
=
(
struct
if_msghdr
*
)
next
;
if
(
ifm
->
ifm_type
==
RTM_IFINFO
)
{
sdl
=
(
struct
sockaddr_dl
*
)(
ifm
+
1
);
memcpy
(
to
,
LLADDR
(
sdl
)
,
ETHER_ADDR_LEN
)
;
res
=
memc
mp
(
to
,
zero_array
,
ETHER_ADDR_LEN
)
?
0
:
1
;
sdl
=
(
struct
sockaddr_dl
*
)(
ifm
+
1
);
addr
=
LLADDR
(
sdl
);
res
=
memc
py_and_test
(
to
,
addr
,
ETHER_ADDR_LEN
);
}
}
...
...
@@ -62,40 +72,94 @@ err:
return
res
;
}
#elif __linux__
#elif defined(__linux__) || defined(__sun__)
#include <net/if.h>
#include <sys/ioctl.h>
#include <net/ethernet.h>
#include <net/if_arp.h>
#ifdef HAVE_SYS_SOCKIO_H
#include <sys/sockio.h>
#endif
#define ETHER_ADDR_LEN 6
my_bool
my_gethwaddr
(
uchar
*
to
)
{
int
fd
,
res
=
1
;
struct
ifreq
ifr
;
char
zero_array
[
ETHER_ADDR_LEN
]
=
{
0
};
struct
ifreq
ifr
[
32
];
struct
ifconf
ifc
;
ifc
.
ifc_req
=
ifr
;
ifc
.
ifc_len
=
sizeof
(
ifr
);
fd
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
);
if
(
fd
<
0
)
goto
err
;
bzero
(
&
ifr
,
sizeof
(
ifr
));
strnmov
(
ifr
.
ifr_name
,
"eth0"
,
sizeof
(
ifr
.
ifr_name
)
-
1
);
do
if
(
ioctl
(
fd
,
SIOCGIFCONF
,
(
char
*
)
&
ifc
)
>=
0
)
{
if
(
ioctl
(
fd
,
SIOCGIFHWADDR
,
&
ifr
)
>=
0
)
uint
i
;
for
(
i
=
0
;
res
&&
i
<
ifc
.
ifc_len
/
sizeof
(
ifr
[
0
]);
i
++
)
{
memcpy
(
to
,
&
ifr
.
ifr_hwaddr
.
sa_data
,
ETHER_ADDR_LEN
);
res
=
memcmp
(
to
,
zero_array
,
ETHER_ADDR_LEN
)
?
0
:
1
;
#ifdef SIOCGIFHWADDR
if
(
ioctl
(
fd
,
SIOCGIFHWADDR
,
&
ifr
[
i
])
>=
0
)
res
=
memcpy_and_test
(
to
,
(
uchar
*
)
&
ifr
[
i
].
ifr_hwaddr
.
sa_data
,
ETHER_ADDR_LEN
);
#else
/*
A bug in OpenSolaris prevents non-root from getting a mac address:
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=4720634
Thus, we'll use an alternative method and extract the address from the
arp table.
*/
struct
arpreq
arpr
;
arpr
.
arp_pa
=
ifr
[
i
].
ifr_addr
;
if
(
ioctl
(
fd
,
SIOCGARP
,
(
char
*
)
&
arpr
)
>=
0
)
res
=
memcpy_and_test
(
to
,
(
uchar
*
)
&
arpr
.
arp_ha
.
sa_data
,
ETHER_ADDR_LEN
);
#endif
}
}
while
(
res
&&
(
errno
==
0
||
errno
==
ENODEV
)
&&
ifr
.
ifr_name
[
3
]
++
<
'6'
);
}
close
(
fd
);
err:
return
res
;
}
#else
/* FreeBSD elif linux */
#elif defined(_WIN32)
#include <winsock2.h>
#include <iphlpapi.h>
#define ETHER_ADDR_LEN 6
my_bool
my_gethwaddr
(
uchar
*
to
)
{
my_bool
res
=
1
;
IP_ADAPTER_INFO
*
info
=
NULL
;
ULONG
info_len
=
0
;
if
(
GetAdaptersInfo
(
info
,
&
info_len
)
!=
ERROR_BUFFER_OVERFLOW
)
goto
err
;
info
=
alloca
(
info_len
);
if
(
GetAdaptersInfo
(
info
,
&
info_len
)
!=
NO_ERROR
)
goto
err
;
while
(
info
&&
res
)
{
if
(
info
->
Type
==
MIB_IF_TYPE_ETHERNET
&&
info
->
AddressLength
==
ETHER_ADDR_LEN
)
res
=
memcpy_and_test
(
to
,
info
->
Address
,
ETHER_ADDR_LEN
);
}
err:
return
res
;
}
#else
/* neither FreeBSD nor linux not Windows */
/* just fail */
my_bool
my_gethwaddr
(
uchar
*
to
__attribute__
((
unused
)))
{
...
...
@@ -114,7 +178,7 @@ int main(int argc __attribute__((unused)),char **argv)
printf
(
"my_gethwaddr failed with errno %d
\n
"
,
errno
);
exit
(
1
);
}
for
(
i
=
0
;
i
<
sizeof
(
mac
);
i
++
)
for
(
i
=
0
;
i
<
sizeof
(
mac
);
i
++
)
{
if
(
i
)
printf
(
":"
);
printf
(
"%02x"
,
mac
[
i
]);
...
...
This diff is collapsed.
Click to expand it.
plugin/feedback/CMakeLists.txt
0 → 100644
View file @
ae633008
INCLUDE
(
"
${
PROJECT_SOURCE_DIR
}
/storage/mysql_storage_engine.cmake"
)
INCLUDE_DIRECTORIES
(
${
CMAKE_SOURCE_DIR
}
/sql
${
CMAKE_SOURCE_DIR
}
/regex
${
CMAKE_SOURCE_DIR
}
/extra/yassl/include
)
SET
(
FEEDBACK_SOURCES feedback.cc sender_thread.cc
url_base.cc url_http.cc utils.cc
)
SET
(
FEEDBACK_LIBS Ws2_32
)
MYSQL_PLUGIN
(
FEEDBACK
)
This diff is collapsed.
Click to expand it.
Prev
1
2
3
Next
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