Re: Weird result set from PEAR's DB
| From: | Joe Stump | Date: | Tue, 29 Mar 2005 23:25:39 +0000 |
| Subject: | Re: Weird result set from PEAR's DB | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-36974@lists.php.net to get a copy of this message | ||
For those of you who haven't read the whole thread here is the lay of the land ...
1.) Server == x86 (see previous posts for exact Linux version)
2.) Client == PPC (powerbook)
Here is a review thus far:
1.) echo '<pre>'.$sql.'</pre>';
2.) copy query
3.) past into mysql terminal (mysql -uroot -h192.168.x.x from powerbook -> x86)
4.) Get column headings like this:
+------+-----------+-----------+---------------+-----+-----+------+-----+-----+
@ | | | @ | @ | | @ | +------+-----------+-----------+---------------+-----+-----+------+-----+-----+ | 0 | Anonymous | asdfasdf | void@asdfasdf.com | | | 0 | 0 | 1 | +------+-----------+-----------+---------------+-----+-----+------+-----+-----+1 row in set (0.00 sec) 5.) Do the same, only from the x86's mysql client and I get the same problem. 6.) Remove \n's from $query in DB_mysql::modifyQuery() with return str_replace("\n",' ',$query); 7.) Queries work great. At this point I can only assume that the client library in MySQL under certain instances don't like \n's. I'm pretty confused why this is bombing like this, it does not appear to be an issue with DB, which was my first idea. --Joe -- Joseph C. Stump joe@joestump.net http://www.joestump.net On Mar 29, 2005, at 3:02 PM, Matthew Weier O'Phinney wrote:
On Tue, 29 Mar 2005 14:52:14 -0800, Joe Stump <joe@joestump.net> wrote:The only thing differing between the two is one is PPC and the other is x86. I can reproduce the bug by copying and pasting the query into my x86 mysql terminal client as well. PPC: jstump@Joseph-Stumps-Computer enotes$ mysql --version mysql Ver 14.7 Distrib 4.1.10a, for apple-darwin7.7.0 (powerpc) jstump@Joseph-Stumps-Computer enotes$ uname -a Darwin Joseph-Stumps-Computer.local 7.8.0 Darwin Kernel Version 7.8.0: Wed Dec 22 14:26:17 PST 2004; root:xnu/xnu-517.11.1.obj~1/RELEASE_PPC Power Macintosh powerpc x86: noc@poweredge:~$ mysql --version mysql Ver 14.7 Distrib 4.1.7, for pc-linux (i686) noc@poweredge:~$ uname -a Linux poweredge 2.4.26-bf2.4 #1 SMP Wed May 26 08:34:11 PDT 2004 i686 GNU/Linux noc@poweredge:~$ Oddly enough, if I remove \n's from the query string it works fine: $sql = "SELECT *What OS is the mysql server running on? This sounds like a classic case of alternate line endings causing issues. You say "if I remove the \n's from the query", but are you removing \n's, \r's, \r\n's, or what? --Matthew Weier O'Phinney mweierophinney@gmail.com http://weierophinney.net/matthew/ --PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpFROM users WHERE username='foo@example.com'";to: $sql = "SELECT * FROM users WHERE username='foo@example.com'"; That fixes the problem as well as adding the DB name before the table (eg. users -> mydb.users). Very odd stuff here.