<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=MDB2_Driver_mysql&amp;PHPSESSID=6sh8hov6085gl1gd4s43b0k8h0</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/16781" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16557" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16525" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16515" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/16781">
      <title>MDB2_Driver_mysql: Bug 16781 [Open] transactions not working</title>
      <link>http://pear.php.net/bugs/16781</link>
      <content:encoded><![CDATA[<pre>MDB2_Driver_mysql Bug
Reported by fanwar
2009-11-11T23:21:57+00:00
PHP: 5.2.3 OS: BSD Package Version: 1.4.1

Description:
------------
I'm having a difficult time with MDB2_driver_mysql and getting it to recognize transactions. I have mysql installed with InnoDB tables and when I do a $db-&gt;supports['transactions'], it keeps returning false. I checked the supported array and the values are just not set. I'm using version 1.4.1 of the driver. Anyone know what the problem may be?

Here is the code I am running:



Before 

Test script:
---------------
$conn_string = &quot;{$dbtype}://{$dbuser}:{$dbpass}@{$dbhost}/{$dbname}&quot;;
		
		$options = array();
		$options['use_transactions'] = true;
		$options['default_table_type'] = 'InnoDB';
		
		$dbconn =&amp; MDB2::singleton($conn_string, $options);
		if (PEAR::isError($dbconn)) {
			getLogger()-&gt;log(&quot;Error creating db connection: &quot; . $dbconn-&gt;getMessage(), CritterSettings::LOG_LEVEL_CRIT);
	   		die($dbconn-&gt;getMessage());
		}

		//BEGIN TRANSACTION HERE
		if ($this-&gt;db-&gt;supports('transactions')) {
		    $this-&gt;db-&gt;beginTransaction();
		} else {
			throw new Exception(&quot;Database is not correctly configured - transactions unsupported&quot;);
		} //the exception keeps getting thrown

Expected result:
----------------
I expect to get true since I am using InnoDB tables and transactions should be supported. 

Actual result:
--------------
I get false and when I print out the supported array, it shows: 

Nov 11 17:08:01  [info] Array
(
    [sequences] =&gt; emulated
    [indexes] =&gt; 1
    [affected_rows] =&gt; 1
    [summary_functions] =&gt; 1
    [order_by_text] =&gt; 1
    [transactions] =&gt;
    [savepoints] =&gt;
    [current_id] =&gt; emulated
    [limit_queries] =&gt; 1
    [LOBs] =&gt; 1
    [replace] =&gt; 1
    [sub_selects] =&gt; emulated
    [auto_increment] =&gt; 1
    [primary_key] =&gt; 1
    [result_introspection] =&gt; 1
    [prepared_statements] =&gt; emulated
    [identifier_quoting] =&gt; 1
    [pattern_escaping] =&gt; 1
    [new_link] =&gt; 1
)</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Driver_mysql Bug
Reported by fanwar
2009-11-11T23:21:57+00:00
PHP: 5.2.3 OS: BSD Package Version: 1.4.1

Description:
------------
I'm having a difficult time with MDB2_driver_mysql and getting it to recognize transactions. I have mysql installed with InnoDB tables and when I do a $db-&gt;supports['transactions'], it keeps returning false. I checked the supported array and the values are just not set. I'm using version 1.4.1 of the driver. Anyone know what the problem may be?

Here is the code I am running:



Before 

Test script:
---------------
$conn_string = &quot;{$dbtype}://{$dbuser}:{$dbpass}@{$dbhost}/{$dbname}&quot;;
		
		$options = array();
		$options['use_transactions'] = true;
		$options['default_table_type'] = 'InnoDB';
		
		$dbconn =&amp; MDB2::singleton($conn_string, $options);
		if (PEAR::isError($dbconn)) {
			getLogger()-&gt;log(&quot;Error creating db connection: &quot; . $dbconn-&gt;getMessage(), CritterSettings::LOG_LEVEL_CRIT);
	   		die($dbconn-&gt;getMessage());
		}

		//BEGIN TRANSACTION HERE
		if ($this-&gt;db-&gt;supports('transactions')) {
		    $this-&gt;db-&gt;beginTransaction();
		} else {
			throw new Exception(&quot;Database is not correctly configured - transactions unsupported&quot;);
		} //the exception keeps getting thrown

Expected result:
----------------
I expect to get true since I am using InnoDB tables and transactions should be supported. 

Actual result:
--------------
I get false and when I print out the supported array, it shows: 

Nov 11 17:08:01  [info] Array
(
    [sequences] =&gt; emulated
    [indexes] =&gt; 1
    [affected_rows] =&gt; 1
    [summary_functions] =&gt; 1
    [order_by_text] =&gt; 1
    [transactions] =&gt;
    [savepoints] =&gt;
    [current_id] =&gt; emulated
    [limit_queries] =&gt; 1
    [LOBs] =&gt; 1
    [replace] =&gt; 1
    [sub_selects] =&gt; emulated
    [auto_increment] =&gt; 1
    [primary_key] =&gt; 1
    [result_introspection] =&gt; 1
    [prepared_statements] =&gt; emulated
    [identifier_quoting] =&gt; 1
    [pattern_escaping] =&gt; 1
    [new_link] =&gt; 1
)</pre>]]></description>
      <dc:date>2009-11-11T23:21:57+00:00</dc:date>
      <dc:creator>fanwar &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2_Driver_mysql Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16557">
      <title>MDB2_Driver_mysql: Bug 16557 [Open] getTableFieldDefinition() returns bogus defaults for NOTNULL columns</title>
      <link>http://pear.php.net/bugs/16557</link>
      <content:encoded><![CDATA[<pre>MDB2_Driver_mysql Bug
Reported by hschletz
2009-08-31T12:28:49+00:00
PHP: Irrelevant OS:  Package Version: CVS

Description:
------------
If a column has a NOT NULL attribute and a default value of NULL, getTableFieldDefinition() changes the default to '' for text columns and '0000-00-00 00:00:00' for timestamp columns.

This behavior is incorrect and not portable. There is no relationship between a NOT NULL constraint and a default value. MySQL reports a NULL default because the default is NULL, not '' or '0000-00-00 00:00:00'.

The attached patch leaves the null value untouched. This also reverts the patch from #12336 completely, which says:

&quot;MySQL uses '0000-00-00 00:00:00' for any timestamp fields with 'NOT NULL'. This driver should set that for any non-null fields that it finds. This will make it work better with MDB2_Schema.&quot;

I disagree (the following statements also apply to text columns):

- The NOT NULL / DEFAULT NULL combination is expected to force the application to provide valid input data. Depending on server SQL mode, MySQL allows NULL anyway, turns it into a pseudo-NULL value and just throws a warning. See also: http://dev.mysql.com/doc/refman/5.0/en/constraint-invalid-data.html
  However, this behavior only applies to MySQL and only in a specific server SQL mode. It does not change the column's definition itself and should not leak out to the application, which might run in a different environment that behaves correctly. In this case it's really up to the developer to stop doing stupid things - MySQL with default settings cannot do this for us.

- As MDB2_Schema is concerned, I had to disable these implicit conversions to make it work as expected.</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Driver_mysql Bug
Reported by hschletz
2009-08-31T12:28:49+00:00
PHP: Irrelevant OS:  Package Version: CVS

Description:
------------
If a column has a NOT NULL attribute and a default value of NULL, getTableFieldDefinition() changes the default to '' for text columns and '0000-00-00 00:00:00' for timestamp columns.

This behavior is incorrect and not portable. There is no relationship between a NOT NULL constraint and a default value. MySQL reports a NULL default because the default is NULL, not '' or '0000-00-00 00:00:00'.

The attached patch leaves the null value untouched. This also reverts the patch from #12336 completely, which says:

&quot;MySQL uses '0000-00-00 00:00:00' for any timestamp fields with 'NOT NULL'. This driver should set that for any non-null fields that it finds. This will make it work better with MDB2_Schema.&quot;

I disagree (the following statements also apply to text columns):

- The NOT NULL / DEFAULT NULL combination is expected to force the application to provide valid input data. Depending on server SQL mode, MySQL allows NULL anyway, turns it into a pseudo-NULL value and just throws a warning. See also: http://dev.mysql.com/doc/refman/5.0/en/constraint-invalid-data.html
  However, this behavior only applies to MySQL and only in a specific server SQL mode. It does not change the column's definition itself and should not leak out to the application, which might run in a different environment that behaves correctly. In this case it's really up to the developer to stop doing stupid things - MySQL with default settings cannot do this for us.

- As MDB2_Schema is concerned, I had to disable these implicit conversions to make it work as expected.</pre>]]></description>
      <dc:date>2009-08-31T12:28:49+00:00</dc:date>
      <dc:creator>holger &amp;#x64;&amp;#111;&amp;#x74; schletz &amp;#x61;&amp;#116; web &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>MDB2_Driver_mysql Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16525">
      <title>MDB2_Driver_mysql: Feature/Change Request 16525 [Open] Please add support for Spatial data types</title>
      <link>http://pear.php.net/bugs/16525</link>
      <content:encoded><![CDATA[<pre>MDB2_Driver_mysql Feature/Change Request
Reported by alsal
2009-08-14T22:43:59+00:00
PHP: 5.3.0 OS: Linux Package Version: 1.4.1

Description:
------------
Support for MYSQL's SPATIAL data formats (i.e: GEOMETRY, POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION)</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Driver_mysql Feature/Change Request
Reported by alsal
2009-08-14T22:43:59+00:00
PHP: 5.3.0 OS: Linux Package Version: 1.4.1

Description:
------------
Support for MYSQL's SPATIAL data formats (i.e: GEOMETRY, POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION)</pre>]]></description>
      <dc:date>2009-08-15T14:17:28+00:00</dc:date>
      <dc:creator>alan &amp;#x61;&amp;#116; y3h &amp;#x64;&amp;#111;&amp;#x74; org</dc:creator>
      <dc:subject>MDB2_Driver_mysql Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16515">
      <title>MDB2_Driver_mysql: Bug 16515 [Open] MDB2_Driver_mysql::lastInsertId(..) fails on php 5.3</title>
      <link>http://pear.php.net/bugs/16515</link>
      <content:encoded><![CDATA[<pre>MDB2_Driver_mysql Bug
Reported by microtrash
2009-08-11T21:23:37+00:00
PHP: 5.3.0 OS: Windows 2003 Package Version: 1.4.1

Description:
------------
The line  return $this-&gt;queryOne('SELECT LAST_INSERT_ID()', 'integer'); in method MDB2_Driver_mysql::lastInsertId(..) fails under php 5.3 returning no ID.  I hacked a working version for myself by replacing that line with the following:


	$result = $this-&gt;_doQuery(&quot;select last_insert_id()&quot;, true);
	$row=mysql_fetch_array($result);
	$ret=$row[0];
  return $ret;</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Driver_mysql Bug
Reported by microtrash
2009-08-11T21:23:37+00:00
PHP: 5.3.0 OS: Windows 2003 Package Version: 1.4.1

Description:
------------
The line  return $this-&gt;queryOne('SELECT LAST_INSERT_ID()', 'integer'); in method MDB2_Driver_mysql::lastInsertId(..) fails under php 5.3 returning no ID.  I hacked a working version for myself by replacing that line with the following:


	$result = $this-&gt;_doQuery(&quot;select last_insert_id()&quot;, true);
	$row=mysql_fetch_array($result);
	$ret=$row[0];
  return $ret;</pre>]]></description>
      <dc:date>2009-08-11T21:23:37+00:00</dc:date>
      <dc:creator>ben &amp;#x61;&amp;#116; imperialwebdesigns &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2_Driver_mysql Bug</dc:subject>
    </item>
</rdf:RDF>
