Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003133 [Quercus] minor always 12-07-08 00:10 01-04-09 14:42
Reporter koreth View Status public  
Assigned To
Priority urgent Resolution open  
Status new   Product Version 3.2.1
Summary 0003133: mysql_query treats MySQL warnings as failures
Description If MySQL responds to a query with a warning, the vanilla PHP interpreter will still return results. Quercus seems to not distinguish between warning and error responses from MySQL.

Since this is a DB thing it's kind of hard to paste in a simple test case; my real-world case is an INSERT ... ON DUPLICATE KEY UPDATE on a table where one of the columns is NOT NULL but has no default value. The row in question already exists and has a value in that column (so the update succeeds) but the column isn't listed in the initial part of the INSERT clause (and thus generates MySQL warning 1364, "Field 'X' doesn't have a default value.")

This query, though it's arguably broken, works in vanilla PHP but in Quercus, mysql_queryf() returns false.
Additional Information
Attached Files

- Relationships

- Notes
12-14-08 13:23

The pause appears to be a mysql driver issue.
12-16-08 10:35

MySQL JDBC driver issue:




mysql_query("DROP TABLE test3");
mysql_query("CREATE TABLE test3 (a VARCHAR(30), b VARCHAR(3) NOT NULL)");
var_dump(mysql_query("INSERT INTO test3 (a) VALUES ('foo')"));



java.sql.SQLException: Field 'b' doesn't have a default value
        at com.mysql.jdbc.SQLError.createSQLException(
        at com.mysql.jdbc.SQLError.createSQLException(
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(
        at com.mysql.jdbc.MysqlIO.sendCommand(
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(
        at com.mysql.jdbc.ConnectionImpl.execSQL(
        at com.mysql.jdbc.ConnectionImpl.execSQL(
        at com.mysql.jdbc.StatementImpl.execute(
        at com.caucho.sql.UserStatement.execute(
        at com.caucho.quercus.lib.db.JdbcConnectionResource.realQuery(JdbcConnec
        at com.caucho.quercus.lib.db.Mysqli.realQuery(
        at com.caucho.quercus.lib.db.Mysqli.query(
        at com.caucho.quercus.lib.db.MysqlModule.mysql_query(

- Issue History
Date Modified Username Field Change
12-07-08 00:10 koreth New Issue
12-14-08 13:23 ferg Note Added: 0003624
12-16-08 10:35 nam Note Added: 0003652
01-04-09 14:42 ferg Priority normal => urgent

Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
32 total queries executed.
28 unique queries executed.
Powered by Mantis Bugtracker