Skip to content

Commit 1e7f6c8

Browse files
author
Anil Toshniwal
committed
Bug#16805643 MTR ERROR "COULD NOT FIND INNOCHECKSUM" IN "MAKE INSTALL"
OUT-OF-SOURCE BUILD 1) Change the extra/CMakeLists.txt to build the innochecksum as per user defined build option. 2) Removed the --debug option for non-debug build of innochecksum. 3) Created new test, innodb-wl6045-debug.test which will run only on innochecksum build in debug. Approved by Kevin, Mattiasj rb#2531
1 parent df9d6c6 commit 1e7f6c8

File tree

9 files changed

+183
-475
lines changed

9 files changed

+183
-475
lines changed

extra/CMakeLists.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,9 @@ IF(WITH_INNOBASE_STORAGE_ENGINE)
9696
../storage/innobase/page/page0zip.cc
9797
)
9898

99-
ADD_VERSION_INFO(innochecksum EXECUTABLE INNOBASE_SOURCES)
100-
ADD_EXECUTABLE(innochecksum innochecksum.cc ${INNOBASE_SOURCES})
99+
MYSQL_ADD_EXECUTABLE(innochecksum innochecksum.cc ${INNOBASE_SOURCES})
101100
TARGET_LINK_LIBRARIES(innochecksum mysys mysys_ssl)
102101
ADD_DEPENDENCIES(innochecksum GenError)
103-
104-
IF(WITH_VALGRIND)
105-
MYSQL_INSTALL_TARGETS(innochecksum DESTINATION ${INSTALL_BINDIR})
106-
ENDIF()
107-
# Note that this will overwrite the non debug "innochecksum" with the
108-
# debug one
109-
INSTALL_DEBUG_TARGET(innochecksum DESTINATION ${INSTALL_BINDIR})
110102
ENDIF()
111103

112104
IF(UNIX)

extra/innochecksum.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,8 +856,10 @@ static struct my_option innochecksum_options[] = {
856856
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
857857
{"verbose", 'v', "Verbose (prints progress every 5 seconds).",
858858
&verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
859+
#ifndef DBUG_OFF
859860
{"debug", '#', "Output debug log. See " REFMAN "dbug-package.html",
860861
&dbug_setting, &dbug_setting, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
862+
#endif /* !DBUG_OFF */
861863
{"count", 'c', "Print the count of pages in the file and exits.",
862864
&just_count, &just_count, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
863865
{"start_page", 's', "Start on this page number (0 based).",
@@ -893,9 +895,15 @@ static struct my_option innochecksum_options[] = {
893895
/* Print out the Innodb version and machine information. */
894896
static void print_version(void)
895897
{
898+
#ifdef DBUG_OFF
896899
printf("%s Ver %s, for %s (%s)\n",
897900
my_progname, INNODB_VERSION_STR,
898901
SYSTEM_TYPE, MACHINE_TYPE);
902+
#else
903+
printf("%s-debug Ver %s, for %s (%s)\n",
904+
my_progname, INNODB_VERSION_STR,
905+
SYSTEM_TYPE, MACHINE_TYPE);
906+
#endif /* DBUG_OFF */
899907
}
900908

901909
static void usage(void)
@@ -919,13 +927,15 @@ innochecksum_get_one_option(
919927
char *argument __attribute__((unused)))
920928
{
921929
switch (optid) {
930+
#ifndef DBUG_OFF
922931
case '#':
923932
dbug_setting = argument
924933
? argument
925934
: IF_WIN("d:O,innochecksum.trace",
926935
"d:o,/tmp/innochecksum.trace");
927936
DBUG_PUSH(dbug_setting);
928937
break;
938+
#endif /* !DBUG_OFF */
929939
case 'e':
930940
use_end_page = true;
931941
break;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
let FILE= $MYSQLTEST_VARDIR/tmp/innochecksum-debug;
2+
--exec $INNOCHECKSUM --version > $FILE
3+
perl;
4+
use strict;
5+
open(FILE, $ENV{FILE}) or die;
6+
$_ = <FILE>;
7+
close(FILE);
8+
my $debug = /innochecksum-debug /;
9+
open(FILE, ">$ENV{FILE}") or die;
10+
print FILE "let \$debug= $debug;\n";
11+
close(FILE);
12+
EOF
13+
14+
--source $FILE
15+
--remove_file $FILE
16+
17+
if (!$debug) {
18+
--skip Test requires innochecksum-debug
19+
}

mysql-test/suite/innodb/r/innodb-wl6045-2.result

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Set the environmental variables
21
SET GLOBAL innodb_file_per_table=on;
32
SET GLOBAL innodb_file_format='barracuda';
43
SELECT @@innodb_compression_level;
@@ -33,13 +32,10 @@ owners.
3332

3433
InnoDB offline file checksum utility.
3534
Usage: innochecksum [-c] [-s <start page>] [-e <end page>] [-p <page>] [-v] [-a <allow mismatches>] [-n] [-C <strict-check>] [-w <write>] [-S] [-D <page type dump>] [-d <dbug-package name>] <filename or [-]>
36-
See REFMAN for usage hints.
3735
-?, --help Displays this help and exits.
3836
-I, --info Synonym for --help.
3937
-V, --version Displays version information and exits.
4038
-v, --verbose Verbose (prints progress every 5 seconds).
41-
-#, --debug[=name] Output debug log. See
42-
REFMAN
4339
-c, --count Print the count of pages in the file and exits.
4440
-s, --start-page=# Start on this page number (0 based).
4541
-e, --end-page=# End at this page number (0 based).
@@ -59,7 +55,6 @@ Variables (--variable-name=value)
5955
and boolean options {FALSE|TRUE} Value (after reading options)
6056
--------------------------------- ----------------------------------------
6157
verbose FALSE
62-
debug FALSE
6358
count FALSE
6459
start-page 0
6560
end-page 0
@@ -137,7 +132,7 @@ insert into t1 values(3,"COMPRESSED");
137132
# Restart the DB server
138133
select * from t1;
139134
drop table t1;
140-
# Test[38] completed
135+
# Test[5] completed
141136
# Restart the server
142137
SET GLOBAL innodb_file_per_table=default;
143138
SET GLOBAL innodb_file_format=default;

mysql-test/suite/innodb/r/innodb-wl6045-linux.result

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
call mtr.add_suppression("InnoDB: Unable to lock");
2-
DROP TABLE IF EXISTS t1;
32
SET GLOBAL innodb_file_per_table=on;
43
SET GLOBAL innodb_file_format='barracuda';
54
SHOW variables like '%innodb_checksum_algorithm%';
@@ -83,7 +82,10 @@ main: info: page::#; log sequence number:first = #; second = #
8382
main: info: Page::# is empty and uncorrupted
8483
#Replace the t.ibd with the newly created a.ibd having crc32 checksum.
8584
# Start the server to validate the t1.ibd having crc32 checksum.
86-
# Server Started normally
85+
select * from t1;
86+
c1 c2
87+
1 Innochecksum InnoDB
88+
2 Innochecksum CRC32
8789
# Shutdown the server
8890
# Test[2] End
8991
# Test[3] for read from standard input for innochecksum tool with rewrite of "none" checksum.
@@ -171,7 +173,10 @@ main: info: Page::# is empty and uncorrupted
171173
main: info: page::#; log sequence number:first = #; second = #
172174
main: info: Page::# is empty and uncorrupted
173175
# Start the server to validate the t1.ibd having "none" checksum.
174-
# Server Started normally
176+
select * from t1;
177+
c1 c2
178+
1 Innochecksum InnoDB
179+
2 Innochecksum CRC32
175180
# Shutdown the server
176181
# Test[3] End
177182
# Test[4] for read from standard input for innochecksum tool with rewrite of "innodb" checksum.
@@ -224,15 +229,13 @@ main: info: page::#; log sequence number:first = #; second = #
224229
main: info: Page::# is empty and uncorrupted
225230
# Replace the t.ibd with the newly created a.ibd having "innodb" checksum.
226231
# Start the server to validate the t1.ibd having "innodb" checksum.
227-
# Server Started normally
228-
# Test[4] End
229-
# Test[5] for lock.
230-
# Test Scenario: As mysqld is running, & then start the innochecksum which must fail.
231232
select * from t1;
232233
c1 c2
233234
1 Innochecksum InnoDB
234235
2 Innochecksum CRC32
235-
# INNOCHECKSUM MYSQLD_DATADIR/test/t1.ibd
236+
# Test[4] End
237+
# Test[5] for lock.
238+
# Test Scenario: As mysqld is running, & then start the innochecksum which must fail.
236239
# create a base table,Index & insert a record
237240
CREATE TABLE tab1(c1 INT PRIMARY KEY,c2 VARCHAR(20)) ENGINE=InnoDB;
238241
CREATE INDEX idx1 ON tab1(c2(10));

0 commit comments

Comments
 (0)