ID: 20510 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Bogus Bug Type: MySQL related Operating System: Linux PHP Version: 4.3.0RC1 New Comment:
Ok, here is the dump schema of the tables. My hunch now is that it is a MySQL problem in general, because a similar happens from the MySQL command line. Anyhow, I've put in a thread about it over at mysql.com. However, I don't think as a bug it's Bogus, because I'm not talking about putting data into a VARCHAR field, but rather padding any type of field on the fly on it's way out. And the data as you'll see if you run the test, is padded without the ORDER BY, but not padded when the ORDER BY is present. Oh, and one more wierd caveat I discovered. The query has to be joining on more than one row, if it only joins on one row it works fine....wierd. So, the dump schema: # start test table schema. USE DATABASE test; # # Table structure for table `table1` # CREATE TABLE table1 ( record int(10) unsigned NOT NULL auto_increment, field1 varchar(30) NOT NULL default '', PRIMARY KEY (record) ) TYPE=MyISAM; # # Dumping data for table `table1` # INSERT INTO table1 VALUES (1, 'test'); # # Table structure for table `table2` # CREATE TABLE table2 ( record int(10) unsigned NOT NULL auto_increment, joinID int(10) unsigned NOT NULL default '0', field2 varchar(30) NOT NULL default '', PRIMARY KEY (record) ) TYPE=MyISAM; # # Dumping data for table `table2` # INSERT INTO table2 VALUES (1, 1, 'join one'); INSERT INTO table2 VALUES (3, 1, 'join two'); Previous Comments: ------------------------------------------------------------------------ [2002-11-20 07:34:32] [EMAIL PROTECTED] Read the 2nd paragraph on: http://www.mysql.com/doc/en/CHAR.html "When CHAR values are stored, they are right-padded with spaces to the specified length. When CHAR values are retrieved, trailing spaces are removed. " Not a bug -> bogus ------------------------------------------------------------------------ [2002-11-19 20:27:01] [EMAIL PROTECTED] <Zeev> it *seems* like a MySQL issue, but it could be some obscure PHP issue. Lets see. C API should be tested with MySQL 3 and MySQL4. Same for the PHP extension. I will do some tests and give feedbacks. ------------------------------------------------------------------------ [2002-11-19 20:07:13] [EMAIL PROTECTED] I never said it's not a bug. It is, the fact is that it's not PHP related but MySQL related, so bugs mysql.com ------------------------------------------------------------------------ [2002-11-19 20:02:09] [EMAIL PROTECTED] The posted details make it sound like a bug to me so unless you truly know the answer nicos I don't think this should be closed. jrust, maybe it'd be helpful if you provide a small db schema that'll go along with a query so others can easily test it. ------------------------------------------------------------------------ [2002-11-19 19:38:43] [EMAIL PROTECTED] I really don't think that can be PHP related... Post a MySQL bug instead? Did you tried that with MySQL 4 (C API)? Anyway if someone feels that I'm wrong, open it again. Thank you for the report. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/20510 -- Edit this bug report at http://bugs.php.net/?id=20510&edit=1
