Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5.33a, 10.0.7, 10.0.14
-
Slackware Linux 14.1 + kernel 3.12.6
Description
cd /usr/mysql-test; ./mtr maria-no-logging
|
(as root) gives me an error report as below. The odd-looking file name starting with a ";" can vary between runs. I am keeping the mysql-test directory, so please let me know if you'd like anything else from it.
CURRENT_TEST: maria.maria-no-logging
|
--- /usr/mysql-test/suite/maria/maria-no-logging.result 2013-09-20 08:34:23.000000000 +1000
|
+++ /usr/mysql-test/suite/maria/maria-no-logging.reject 2013-10-10 12:49:38.000000000 +1100
|
@@ -20,18 +20,18 @@
|
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 TRANSACTIONAL=1
|
show engine aria logs;
|
Type Name Status
|
-Aria Size 16384 aria_log.00000001 unknown
|
+Aria Size 16384 ; ?r unknown
|
insert into t1 values('a');
|
insert into t1 select * from t2;
|
show engine aria logs;
|
Type Name Status
|
-Aria Size 24576 aria_log.00000001 unknown
|
+Aria Size 24576 ; ?r unknown
|
* shut down mysqld, removed logs, restarted it
|
truncate table t1;
|
insert into t1 select * from t2;
|
show engine aria logs;
|
Type Name Status
|
-Aria Size 16384 aria_log.00000001 unknown
|
+Aria Size 16384 ; ?r unknown
|
drop table t1;
|
* shut down mysqld, removed logs, restarted it
|
create table t1 (a varchar(100)) engine=aria transactional=1;
|
@@ -41,11 +41,11 @@
|
Note 1050 Table 't1' already exists
|
show engine aria logs;
|
Type Name Status
|
-Aria Size 16384 aria_log.00000001 unknown
|
+Aria Size 16384 ; ?r unknown
|
* shut down mysqld, removed logs, restarted it
|
drop table t1;
|
create table t1 engine=aria transactional=1 select * from t2;
|
show engine aria logs;
|
Type Name Status
|
-Aria Size 16384 aria_log.00000001 unknown
|
+Aria Size 16384 ; ?r unknown
|
drop database mysqltest;
|
The problem is a in the stat structure at /usr/include/i386-linux-gnu/bits/stat.h
Depending on how you compile your program (with or without __USE_FILE_OFFSET64) the structure gets different sizes.
Here is an example:
#if defined __x86_64__ || !defined __USE_FILE_OFFSET64
__off_t st_size; /* Size of file, in bytes. */
#else
__off64_t st_size; /* Size of file, in bytes. */
#endif
The variable is either 4 or 8 bytes, depending on the value of __USE_FILE_OFFSET64,
In storage/maria/ha_maria.cc, we included files in a non standard order and struct stat got to be defined too small, which caused memory overruns.
I have now fixed so that we always include <my_global.h> first, which fixes this issue. I will push this into 10.0 tree shortly
However someone should fix so that 'struct stat' has always the same size, independent of how you compile it on x86.
On 64 bits it's always the same size.