Bug #38215 | Query fails to return correct info from table | ||
---|---|---|---|
Submitted: | 17 Jul 2008 20:55 | Modified: | 20 Aug 2009 6:14 |
Reporter: | Mattias Eriksson | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | 5.0.67 | OS: | FreeBSD |
Assigned to: | CPU Architecture: | Any |
[17 Jul 2008 20:55]
Mattias Eriksson
[18 Jul 2008 3:41]
Valeriy Kravchuk
Thank you for a problem report. As 5.0.51 binaries for FreeBSD on that platfrom are not created by MySQL (see http://dev.mysql.com/downloads/mysql/5.0.html#freebsd), please, send the configure command line and gcc version used to build them.
[18 Jul 2008 8:40]
Mattias Eriksson
The gcc version used is the one shipped with FreeBSD 6.3 sparc64 [root@njord ~]# gcc --version gcc (GCC) 3.4.6 [FreeBSD] 20060305 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The mysql version was originaly 5.0.45 from ports built by FreeBSD ports maintainer. But when I discovered the problem I removed 5.0.45 and build 5.0.51 frm ports hoping that the problem would disappear, but it didn't. So here is the ./configure taken from config.log: ./configure --localstatedir=/var/db/mysql --without-debug --without-readline --without-libedit --without-bench --without-extra-tools --with-libwrap --with-mysqlfs --with-low-memory --with-comment=FreeBSD port: mysql-server-5.0.51a --enable-thread-safe-client --with-named-thread-libs=-pthread --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/ --build=sparc64-portbld-freebsd6.3 I will attach config.log as well.
[6 Aug 2008 9:34]
Susanne Ebrecht
Many thanks for reporting a bug. I can't repeat this by using FreeBSD 7.0 and AMD64 architecture. mysql> SELECT /* Parser::replaceLinkHolders WikiSysop */ * FROM `page` WHERE (page_namespace=0 AND page_title IN('TCP', 'UDP', 'PIM', 'RIPng', 'OSPFv6', 'RIP', 'TP4', 'SCTP', 'HP', 'Huvudsidan', 'Extreme_Networks', 'Cisco', 'Allied_Telesyn', 'OSPF', 'IS-IS', 'SDH', 'Token_Ring', 'FDDI', 'Ethernet', 'Optisk_fiber', 'Spanning-tree', 'CLNS', 'BGP', 'EIGRP', 'IPX', 'IPv6', 'IPv4', 'Twisted_pair'))\G *************************** 1. row *************************** page_id: 7 page_namespace: 0 page_title: Cisco page_restrictions: page_counter: 4 page_is_redirect: 0 page_is_new: 0 page_random: 0.626507716055 page_touched: 20080717113152 page_latest: 54 page_len: 222 *************************** 2. row *************************** page_id: 6 page_namespace: 0 page_title: Huvudsidan page_restrictions: page_counter: 2 page_is_redirect: 1 page_is_new: 0 page_random: 0.14495238096 page_touched: 20080717152458 page_latest: 43 page_len: 23 *************************** 3. row *************************** page_id: 5 page_namespace: 0 page_title: IS-IS page_restrictions: page_counter: 36 page_is_redirect: 0 page_is_new: 0 page_random: 0.862870064524 page_touched: 20080717135928 page_latest: 104 page_len: 4182 *************************** 4. row *************************** page_id: 16 page_namespace: 0 page_title: OSPF page_restrictions: page_counter: 4 page_is_redirect: 0 page_is_new: 0 page_random: 0.235461878317 page_touched: 20080717140003 page_latest: 106 page_len: 142 4 rows in set (0.01 sec) Unfortunately, we don't have a sparc test machine with FreeBSD. Please paste output from: EXPLAIN SELECT /* Parser::replaceLinkHolders WikiSysop */ * FROM `page` WHERE (page_namespace=0 AND page_title IN('TCP', 'UDP', 'PIM', 'RIPng', 'OSPFv6', 'RIP', 'TP4', 'SCTP', 'HP', 'Huvudsidan', 'Extreme_Networks', 'Cisco', 'Allied_Telesyn', 'OSPF', 'IS-IS', 'SDH', 'Token_Ring', 'FDDI', 'Ethernet', 'Optisk_fiber', 'Spanning-tree', 'CLNS', 'BGP', 'EIGRP', 'IPX', 'IPv6', 'IPv4', 'Twisted_pair')) Also I need to know, which FreeBSD version you use.
[6 Aug 2008 9:35]
Susanne Ebrecht
Sorry, I forgot ... it also would be nice when you try the newer MySQL version: MySQL 5.0.51b.
[6 Aug 2008 11:13]
Mattias Eriksson
I am using FreeBSD 6.3 on sparc64. Here is the output from the query: mysql> EXPLAIN SELECT /* Parser::replaceLinkHolders WikiSysop */ * FROM `page` WHERE (page_namespace=0 AND page_title IN('TCP', 'UDP', 'PIM', 'RIPng', 'OSPFv6', 'RIP', 'TP4', 'SCTP', 'HP', 'Huvudsidan', 'Extreme_Networks', 'Cisco', 'Allied_Telesyn', 'OSPF', 'IS-IS', 'SDH', 'Token_Ring', 'FDDI', 'Ethernet', 'Optisk_fiber', 'Spanning-tree', 'CLNS', 'BGP', 'EIGRP', 'IPX', 'IPv6', 'IPv4', 'Twisted_pair')); +----+-------------+-------+------+---------------+------------+---------+-------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+---------------+------------+---------+-------+------+-------------+ | 1 | SIMPLE | page | ref | name_title | name_title | 4 | const | 1 | Using where | +----+-------------+-------+------+---------------+------------+---------+-------+------+-------------+ 1 row in set (0.01 sec) mysql>
[6 Aug 2008 11:31]
Mattias Eriksson
Thanks for your efforts. There are more differences than similarities between sparc64 and amd64. Both are 64bit but sparc64 is bigendian and has different memory alignments. I think it would be necessary to set up a system with FreeBSD 6.3 on sparc64 to resolve this. My FreeBSD install is from the distribution CD. I will try to recompile mysql, with the new version as soon as possible, but I need to do changes to the ports build script. Best Regards. Mattias
[6 Aug 2008 12:00]
Susanne Ebrecht
Hmmm, that looks the same as here. Can you try to shrink the SELECT Statement down so that we could get more exact informations which part isn't working correct. I mean something like: SELECT /* Parser::replaceLinkHolders WikiSysop */ * FROM `page` WHERE (page_namespace=0 AND page_title IN('OSPF')); Or just SELECT /* Parser::replaceLinkHolders WikiSysop */ * FROM `page` WHERE page_title IN(..., 'OSPF', ...));
[6 Aug 2008 13:01]
Mattias Eriksson
I hope I understand you correct. This is the output when running my debug script. Note that I am running this against my production database, and I have added more pages to wikipedia (OSPFv6). The script will be attached in a minute. [materi@njord ~]$ ./debug_mysql.sh page_id page_namespace page_title page_restrictions page_counter page_is_redirect page_is_new page_random page_touched page_latest page_len 18 0 OSPFv6 3 0 0 0.334469699443 20080722085332 135 1787 page_id page_namespace page_title page_restrictions page_counter page_is_redirect page_is_new page_random page_touched page_latest page_len 6 0 Huvudsidan 2 1 0 0.14495238096 20080723185017 43 23 page_id page_namespace page_title page_restrictions page_counter page_is_redirect page_is_new page_random page_touched page_latest page_len 7 0 Cisco 43 0 0 0.626507716055 20080727104908 178 1176 page_id page_namespace page_title page_restrictions page_counter page_is_redirect page_is_new page_random page_touched page_latest page_len 16 0 OSPF 11 0 0 0.235461878317 20080722090127 172 183 page_id page_namespace page_title page_restrictions page_counter page_is_redirect page_is_new page_random page_touched page_latest page_len 5 0 IS-IS 58 0 0 0.862870064524 20080722090102 171 5640
[6 Aug 2008 13:04]
Mattias Eriksson
Would it be easier if you had access to the database? If that would be better, then how do we communicate passwords,ip addresses and such, securely. Best Regards
[6 Aug 2008 13:26]
Mattias Eriksson
More results
Attachment: mysql_more_results.txt.gz (application/x-gzip, text), 764 bytes.
[6 Aug 2008 13:52]
Susanne Ebrecht
The results are just mad and I have seen such a behaviour before ... I have to search when and where it was.
[6 Aug 2008 13:53]
Mattias Eriksson
The previous file clearly shows the variation of the result.
[6 Aug 2008 17:36]
Mattias Eriksson
I've rebuilt mysql (version 5.0.51b) without any freebsd patches (from ports) but the database still behaves like previous versions. The bug persists. I ran my debug script and the output was exactly the same.
[7 Aug 2008 11:37]
Susanne Ebrecht
I am pretty sure that I saw a similar behaviour a few weeks ago ... I meant that a comparing list of strings won't compare right on some OS. But I can't find the bug report again.
[9 Aug 2008 7:28]
Valeriy Kravchuk
Please, try to repeat with a newer version, 5.0.67, and inform about the results.
[9 Aug 2008 11:02]
Mattias Eriksson
I've rebuilt mysql using version 5.0.67 and there is no difference, the bug is still there. Does any one have any pointers to where the comparison occurs in the source? Or any other ways to do more debugging? Regards
[16 Oct 2008 19:59]
Sveta Smirnova
Thank you for the feedback. Please try to compile without options --without-readline --without-libedit to see if it affects. Also please provide output of SHOW VARIABLES LIKE 'char%', SHOW VARIABLES LIKE 'coll%' and SHOW CREATE TABLE page on both FreeBSD and Linux. I want to check client character set/collation settings you use and table create options.
[17 Oct 2008 18:33]
Mattias Eriksson
Output from above queries on FreeBSD (sparc64)
Attachment: codepages_FreeBSD.txt (text/plain), 5.29 KiB.
[17 Oct 2008 18:34]
Mattias Eriksson
Output from above queries on Linux (i386)
Attachment: codepages_Linux.txt (text/plain), 5.31 KiB.
[17 Oct 2008 18:36]
Mattias Eriksson
I ran my debug script and the queries on FreeBSD, still returns incorrect results. Best Regards Mattias
[17 Oct 2008 18:40]
Mattias Eriksson
...forgot to explicitly say that I did recompile mysql-5.0.67 as you suggested. Cheers.
[4 Feb 2009 10:49]
Susanne Ebrecht
Unfortunately, we don't have FreeBSD on a bigendian ... but if it is an endian problem it should be reproducable with other OS on bigendian. As soon as I have installed actual 5.0 on such a machine I will give it a try and test it again.
[4 Feb 2009 12:13]
Susanne Ebrecht
Not repeatable with PPC.
[23 Mar 2009 15:55]
Susanne Ebrecht
Mattias, we still aren't able to repeat your behaviour. The only thing what we can do at the moment is to plead you to try all with MySQL 5.1.
[23 Apr 2009 23:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[17 Aug 2009 8:42]
Susanne Ebrecht
We are still waiting for the report what happens with 5.1 here.
[17 Aug 2009 21:34]
Mattias Eriksson
I have replaced my server with x86/amd64 hardware and Linux, since I know that it works. I needed to have MySQL working, it's a production server.
[20 Aug 2009 6:14]
Susanne Ebrecht
Many thanks for your feedback. Of course changing sparc against x86 is not a workaround at all. Anyway, we still don't have a sparc + FreeBSD test machine. I will set this to can't repeat now.