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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
08819a37
Commit
08819a37
authored
Jan 29, 2011
by
John H. Embretsen
Browse files
Options
Browse Files
Download
Plain Diff
Merge fix for bug 56817 from mysql-5.1 to mysql-5.5.
parents
70e3313e
26528be7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
189 additions
and
2 deletions
+189
-2
mysql-test/include/have_dbi_dbd-mysql.inc
mysql-test/include/have_dbi_dbd-mysql.inc
+78
-0
mysql-test/include/mysqlhotcopy.inc
mysql-test/include/mysqlhotcopy.inc
+14
-0
mysql-test/std_data/checkDBI_DBD-mysql.pl
mysql-test/std_data/checkDBI_DBD-mysql.pl
+97
-0
mysql-test/t/disabled.def
mysql-test/t/disabled.def
+0
-2
No files found.
mysql-test/include/have_dbi_dbd-mysql.inc
0 → 100644
View file @
08819a37
#
# Originally created by John Embretsen, 2011-01-26.
#
# Checks for the existence of Perl modules DBI and DBD::mysql as seen from the
# perl installation used by "external" executable perl scripts, i.e. scripts
# that are executed as standalone scripts interpreted by the perl installation
# specified by the "shebang" line in the top of these scripts.
#
# If either module is not found, the test will be skipped.
#
# For use in tests that call perl scripts that require these modules.
#
# This file is intended to work on Unix. Windows may need different treatment.
# Reasoning:
# - "shebangs" are not relevant on Windows, but need to be handled here.
# - Perl scripts cannot be made executable on Windows, interpreter must be
# specified.
#
# Note that if there are multiple perl installations and not all have the
# required modules, this check may fail even if the perl in path does have
# the modules available. This may happen if the perl specified by the script's
# shebang (e.g. #!/usr/bin/perl) does not have these modules, and script is
# called without specifying the perl interpreter. However, this will be
# a correct result in cases where a test calls a script with a similar shebang.
#
################################################################################
--
source
include
/
not_windows
.
inc
# We jump through some hoops since there is no direct way to check if an
# external command went OK or not from a mysql-test file:
#
# - In theory, we could do as simple as "exec perl -MDBI -MDBD::mysql -e 1",
# however we cannot check the result (exit code) from within a test script.
# Also, this may not yield the same result as other uses of perl due to the
# shebang issue mentioned above.
# - Instead we use a separate helper perl script that checks for the modules.
# - If the modules are found, the perl script leaves a file which sets a
# variable that can be read by this file.
# If the modules are not found, the perl script does not set this variable,
# but leaves an empty file instead.
#
# This is done because there is apparently no direct way to transfer
# information from perl to the test script itself.
--
disable_query_log
--
disable_result_log
--
disable_warnings
# We do not use embedded perl in this script because that would not have yielded
# correct results for a situation where an external Perl script is called like
# "scriptname" instead of "perl scriptname" and the shebang in the script points
# to a specific perl that may be different than the perl in PATH.
#
# Instead, we call a separate helper script which checks for the modules in its
# own environment. We call it without "perl" in front.
--
let
$perlChecker
=
$MYSQLTEST_VARDIR
/
std_data
/
checkDBI_DBD
-
mysql
.
pl
--
let
$resultFile
=
$MYSQL_TMP_DIR
/
dbidbd
-
mysql
.
txt
# Make the script executable and execute it.
--
chmod
0755
$perlChecker
--
exec
$perlChecker
# Source the resulting temporary file and look for a variable being set.
--
source
$resultFile
if
(
!
$dbidbd
)
{
--
skip
Test
needs
Perl
modules
DBI
and
DBD
::
mysql
}
# Clean up
--
remove_file
$resultFile
--
enable_query_log
--
enable_result_log
--
enable_warnings
mysql-test/include/mysqlhotcopy.inc
View file @
08819a37
...
...
@@ -4,12 +4,26 @@
--
source
include
/
not_windows
.
inc
--
source
include
/
not_embedded
.
inc
--
source
include
/
have_dbi_dbd
-
mysql
.
inc
if
(
!
$MYSQLHOTCOPY
)
{
# Fail the test if the mysqlhotcopy script is missing.
# If the tool's location changes, mysql-test-run.pl must be updated to
# reflect this (look for "MYSQLHOTCOPY").
die
due
to
missing
mysqlhotcopy
tool
;
}
# NOTE (johnemb, 2011-01-26):
# In this test mysqlhotcopy (a perl script) is executed as a standalone
# executable, i.e. not necessarily using the perl interpreter in PATH,
# because that is how the documentation demonstrates it.
#
# We include have_dbi_dbd-mysql.inc above so that the test will
# be skipped if Perl modules required by the mysqlhotcopy tool are not
# found when the script is run this way.
let
$MYSQLD_DATADIR
=
`SELECT @@datadir`
;
--
disable_warnings
DROP
DATABASE
IF
EXISTS
hotcopy_test
;
...
...
mysql-test/std_data/checkDBI_DBD-mysql.pl
0 → 100644
View file @
08819a37
#!/usr/bin/perl
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; version 2
# of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
################################################################################
#
# This perl script checks for availability of the Perl modules DBI and
# DBD::mysql using the "current" perl interpreter.
#
# Useful for test environment checking before testing executable perl scripts
# in the MySQL Server distribution.
#
# NOTE: The "shebang" on the first line of this script should always point to
# /usr/bin/perl, so that we can use this script to check whether or not we
# support running perl scripts with such a shebang without specifying the
# perl interpreter on the command line. Such a script is mysqlhotcopy.
#
# When run as "checkDBI_DBD-mysql.pl" the shebang line will be evaluated
# and used. When run as "perl checkDBI_DBD-mysql.pl" the shebang line is
# not used.
#
# NOTE: This script will create a temporary file in MTR's tmp dir.
# If modules are found, a mysql-test statement which sets a special
# variable is written to this file. If one of the modules is not found
# (or cannot be loaded), the file will remain empty.
# A test (or include file) which sources that file can then easily do
# an if-check on the special variable to determine success or failure.
#
# Example:
#
# --let $perlChecker= $MYSQLTEST_VARDIR/std_data/checkDBI_DBD-mysql.pl
# --let $resultFile= $MYSQL_TMP_DIR/dbidbd-mysql.txt
# --chmod 0755 $perlChecker
# --exec $perlChecker
# --source $resultFile
# if (!$dbidbd) {
# --skip Test needs Perl modules DBI and DBD::mysql
# }
#
# The calling script is also responsible for cleaning up after use:
#
# --remove_file $resultFile
#
# Windows notes:
# - shebangs may work differently - call this script with "perl " in front.
#
# See mysql-test/include/have_dbi_dbd-mysql.inc for example use of this script.
# This script should be executable for the user running MTR.
#
################################################################################
BEGIN
{
# By using eval inside BEGIN we can suppress warnings and continue after.
# We need to catch "Can't locate" as well as "Can't load" errors.
eval
{
$FOUND_DBI
=
0
;
$FOUND_DBD_MYSQL
=
0
;
# Check for DBI module:
$FOUND_DBI
=
1
if
require
DBI
;
# Check for DBD::mysql module
$FOUND_DBD_MYSQL
=
1
if
require
DBD::
mysql
;
};
};
# Open a file to be used for transfer of result back to mysql-test.
# The file must be created whether we write to it or not, otherwise mysql-test
# will complain if trying to source it.
# An empty file indicates failure to load modules.
open
(
FILE
,
"
>
",
$ENV
{'
MYSQL_TMP_DIR
'}
.
'
/dbidbd-mysql.txt
');
if
(
$FOUND_DBI
&&
$FOUND_DBD_MYSQL
)
{
# write a mysql-test command setting a variable to indicate success
print
(
FILE
'
let $dbidbd= FOUND_DBI_DBD-MYSQL;
'
.
"
\n
");
}
# close the file.
close
(
FILE
);
1
;
mysql-test/t/disabled.def
View file @
08819a37
...
...
@@ -11,8 +11,6 @@
##############################################################################
lowercase_table3 : Bug#54845 2010-06-30 alik main.lowercase_table3 on Mac OSX
query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically
main.mysqlhotcopy_myisam : Bug#56817 2010-10-21 anitha mysqlhotcopy* fails
main.mysqlhotcopy_archive: Bug#56817 2010-10-21 anitha mysqlhotcopy* fails
log_tables-big : Bug#48646 2010-11-15 mattiasj report already exists
read_many_rows_innodb : Bug#37635 2010-11-15 mattiasj report already exists
sum_distinct-big : Bug#56927 2010-11-15 mattiasj was not tested
...
...
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