<?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_Schema</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/16798" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16361" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16258" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15886" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15276" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15189" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15064" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14985" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13779" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13544" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12154" />
      <rdf:li rdf:resource="http://pear.php.net/bug/11961" />
      <rdf:li rdf:resource="http://pear.php.net/bug/11696" />
      <rdf:li rdf:resource="http://pear.php.net/bug/10122" />
      <rdf:li rdf:resource="http://pear.php.net/bug/9452" />
      <rdf:li rdf:resource="http://pear.php.net/bug/8645" />
      <rdf:li rdf:resource="http://pear.php.net/bug/8075" />

     </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/16798">
      <title>MDB2_Schema: Bug 16798 [Open] Validator choking on its own generated schema</title>
      <link>http://pear.php.net/bugs/16798</link>
      <content:encoded><![CDATA[<pre>MDB2_Schema Bug
Reported by yunosh
2009-11-18T14:36:55+00:00
PHP: Irrelevant OS:  Package Version: 0.8.5

Description:
------------
Excuse my laziness and let me quote from a mailing list conversation:

&gt; Zitat von GastÃ³n SansÃ³ &lt;gaston.sanso@gmail.com&gt;:
&gt;
&gt;&gt; On Fri, Nov 13, 2009 at 7:54 AM, Jan Schneider &lt;jan@horde.org&gt; wrote:
&gt;&gt;&gt; Zitat von Jan Schneider &lt;jan@horde.org&gt;:
&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Zitat von GastÃ³n SansÃ³ &lt;gaston.sanso@gmail.com&gt;:
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Hi, I'm getting the following error while trying to upgrade  Horde
&gt;&gt;&gt;&gt;&gt; Groupware Webmail Edition from version 1.2 to 1.2.4:
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; [ ERROR! ] Reading the existing table structure failed. Error messages:
&gt;&gt;&gt;&gt;&gt; MDB2_Schema Error: schema validation error
&gt;&gt;&gt;&gt;&gt; default value of &quot;pref_scope&quot; is incorrect: &quot;''::character varying&quot; is
&gt;&gt;&gt;&gt;&gt; larger than &quot;16&quot;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; This sounds like a bug in MDB2_Schema. I think this is what happens: to
&gt;&gt;&gt;&gt; update the database mdb2 first reads the existing database schema. 
&gt;&gt;&gt;&gt; As if it
&gt;&gt;&gt;&gt; doesn't trust its own generated data, it tries to validates the parsed
&gt;&gt;&gt;&gt; schema. This is the point where it fails, because PostgreSQL returns the
&gt;&gt;&gt;&gt; default value of the pref_scope tables as &quot;''::character varying&quot;. This of
&gt;&gt;&gt;&gt; course only means '', the last part is just a casting instruction. But the
&gt;&gt;&gt;&gt; validator doesn't know this, and counts the complete string as the default
&gt;&gt;&gt;&gt; value, which exceeds the maximum size of 16 characters for that column.
&gt;&gt;&gt;&gt; Boof.
&gt;&gt;&gt;
&gt;&gt;&gt; Try if upgrading MDB2 and MDB2_Schema fixes this. Should work with the
&gt;&gt;&gt; following from the horde directory:
&gt;&gt;&gt;
&gt;&gt;&gt; ./pear/pear -c pear/horde.ini -d preferred_state=beta upgrade mdb2
&gt;&gt;&gt; mdb2_driver_pgsql mdb2_schema
&gt;&gt;&gt;
&gt;&gt;&gt; The run the upgrade script again. But first please make sure to have
&gt;&gt;&gt; backups.
&gt;&gt;&gt;
&gt;&gt;&gt; Jan.
&gt;&gt;&gt;
&gt;&gt;&gt; --
&gt;&gt;&gt; Do you need professional PHP or Horde consulting?
&gt;&gt;&gt; http://horde.org/consulting/
&gt;&gt;&gt;
&gt;&gt;&gt; --
&gt;&gt;&gt; Horde mailing list - Join the hunt: http://horde.org/bounties/#horde
&gt;&gt;&gt; Frequently Asked Questions: http://horde.org/faq/
&gt;&gt;&gt; To unsubscribe, mail: horde-unsubscribe@lists.horde.org
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt; Hi Jan, thanks for the reply. I did what you said , first I  updated
&gt;&gt; PEAR by selecting option 4 in setup.php. then
&gt;&gt;
&gt;&gt; ./pear/pear -c pear/horde.ini -d preferred_state=beta upgrade mdb2
&gt;&gt; mdb2_driver_pgsql mdb2_schema
&gt;&gt;
&gt;&gt;
&gt;&gt; but when I run option 5 to do the upgrade I'm still getting the same error:
&gt;&gt;
&gt;&gt; [ ERROR! ] Reading the existing table structure failed. Error messages:
&gt;&gt; MDB2_Schema Error: schema validation error
&gt;&gt; default value of &quot;pref_scope&quot; is incorrect: &quot;''::character varying&quot; is
&gt;&gt; larger than &quot;16&quot;
&gt;&gt;
&gt;
&gt; So, the bug still exists in the latest version of MDB2_Schema and 
&gt; should be reported there.</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Schema Bug
Reported by yunosh
2009-11-18T14:36:55+00:00
PHP: Irrelevant OS:  Package Version: 0.8.5

Description:
------------
Excuse my laziness and let me quote from a mailing list conversation:

&gt; Zitat von GastÃ³n SansÃ³ &lt;gaston.sanso@gmail.com&gt;:
&gt;
&gt;&gt; On Fri, Nov 13, 2009 at 7:54 AM, Jan Schneider &lt;jan@horde.org&gt; wrote:
&gt;&gt;&gt; Zitat von Jan Schneider &lt;jan@horde.org&gt;:
&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Zitat von GastÃ³n SansÃ³ &lt;gaston.sanso@gmail.com&gt;:
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Hi, I'm getting the following error while trying to upgrade  Horde
&gt;&gt;&gt;&gt;&gt; Groupware Webmail Edition from version 1.2 to 1.2.4:
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; [ ERROR! ] Reading the existing table structure failed. Error messages:
&gt;&gt;&gt;&gt;&gt; MDB2_Schema Error: schema validation error
&gt;&gt;&gt;&gt;&gt; default value of &quot;pref_scope&quot; is incorrect: &quot;''::character varying&quot; is
&gt;&gt;&gt;&gt;&gt; larger than &quot;16&quot;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; This sounds like a bug in MDB2_Schema. I think this is what happens: to
&gt;&gt;&gt;&gt; update the database mdb2 first reads the existing database schema. 
&gt;&gt;&gt;&gt; As if it
&gt;&gt;&gt;&gt; doesn't trust its own generated data, it tries to validates the parsed
&gt;&gt;&gt;&gt; schema. This is the point where it fails, because PostgreSQL returns the
&gt;&gt;&gt;&gt; default value of the pref_scope tables as &quot;''::character varying&quot;. This of
&gt;&gt;&gt;&gt; course only means '', the last part is just a casting instruction. But the
&gt;&gt;&gt;&gt; validator doesn't know this, and counts the complete string as the default
&gt;&gt;&gt;&gt; value, which exceeds the maximum size of 16 characters for that column.
&gt;&gt;&gt;&gt; Boof.
&gt;&gt;&gt;
&gt;&gt;&gt; Try if upgrading MDB2 and MDB2_Schema fixes this. Should work with the
&gt;&gt;&gt; following from the horde directory:
&gt;&gt;&gt;
&gt;&gt;&gt; ./pear/pear -c pear/horde.ini -d preferred_state=beta upgrade mdb2
&gt;&gt;&gt; mdb2_driver_pgsql mdb2_schema
&gt;&gt;&gt;
&gt;&gt;&gt; The run the upgrade script again. But first please make sure to have
&gt;&gt;&gt; backups.
&gt;&gt;&gt;
&gt;&gt;&gt; Jan.
&gt;&gt;&gt;
&gt;&gt;&gt; --
&gt;&gt;&gt; Do you need professional PHP or Horde consulting?
&gt;&gt;&gt; http://horde.org/consulting/
&gt;&gt;&gt;
&gt;&gt;&gt; --
&gt;&gt;&gt; Horde mailing list - Join the hunt: http://horde.org/bounties/#horde
&gt;&gt;&gt; Frequently Asked Questions: http://horde.org/faq/
&gt;&gt;&gt; To unsubscribe, mail: horde-unsubscribe@lists.horde.org
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt; Hi Jan, thanks for the reply. I did what you said , first I  updated
&gt;&gt; PEAR by selecting option 4 in setup.php. then
&gt;&gt;
&gt;&gt; ./pear/pear -c pear/horde.ini -d preferred_state=beta upgrade mdb2
&gt;&gt; mdb2_driver_pgsql mdb2_schema
&gt;&gt;
&gt;&gt;
&gt;&gt; but when I run option 5 to do the upgrade I'm still getting the same error:
&gt;&gt;
&gt;&gt; [ ERROR! ] Reading the existing table structure failed. Error messages:
&gt;&gt; MDB2_Schema Error: schema validation error
&gt;&gt; default value of &quot;pref_scope&quot; is incorrect: &quot;''::character varying&quot; is
&gt;&gt; larger than &quot;16&quot;
&gt;&gt;
&gt;
&gt; So, the bug still exists in the latest version of MDB2_Schema and 
&gt; should be reported there.</pre>]]></description>
      <dc:date>2009-11-18T14:36:55+00:00</dc:date>
      <dc:creator>jan &amp;#x61;&amp;#116; horde &amp;#x64;&amp;#111;&amp;#x74; org</dc:creator>
      <dc:subject>MDB2_Schema Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16361">
      <title>MDB2_Schema: Feature/Change Request 16361 [Open] SPATIAL support.</title>
      <link>http://pear.php.net/bugs/16361</link>
      <content:encoded><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by antigremlin
2009-06-22T03:00:42+00:00
PHP: Irrelevant OS: CentOS Package Version: 0.8.5

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_Schema Feature/Change Request
Reported by antigremlin
2009-06-22T03:00:42+00:00
PHP: Irrelevant OS: CentOS Package Version: 0.8.5

Description:
------------
Support for MYSQL's SPATIAL data formats (i.e: GEOMETRY, POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION)</pre>]]></description>
      <dc:date>2009-06-22T03:00:42+00:00</dc:date>
      <dc:creator>derek &amp;#x61;&amp;#116; amplitude &amp;#x64;&amp;#111;&amp;#x74; com &amp;#x64;&amp;#111;&amp;#x74; au</dc:creator>
      <dc:subject>MDB2_Schema Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16258">
      <title>MDB2_Schema: Feature/Change Request 16258 [Open] foreign key not supported in updateDatabase()</title>
      <link>http://pear.php.net/bugs/16258</link>
      <content:encoded><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by ebadr
2009-05-24T17:11:42+00:00
PHP: Irrelevant OS:  Package Version: 0.8.5

Description:
------------
when using updateDatabase() I realized that it don't support foreign key changes 

also the pre-requests for that like definition changes not supported</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by ebadr
2009-05-24T17:11:42+00:00
PHP: Irrelevant OS:  Package Version: 0.8.5

Description:
------------
when using updateDatabase() I realized that it don't support foreign key changes 

also the pre-requests for that like definition changes not supported</pre>]]></description>
      <dc:date>2009-05-24T17:11:42+00:00</dc:date>
      <dc:creator>eslam &amp;#x64;&amp;#111;&amp;#x74; bader &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2_Schema Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15886">
      <title>MDB2_Schema: Feature/Change Request 15886 [Open] Import Problem with Foreign Keys</title>
      <link>http://pear.php.net/bugs/15886</link>
      <content:encoded><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by tacki
2009-02-09T11:25:44+00:00
PHP: 5.2.8 OS: Fedora Package Version: 

Description:
------------
   I exported a simple mysql table-layout with 1 foreign key:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?&gt;
&lt;database&gt;

 &lt;name&gt;test&lt;/name&gt;
 &lt;create&gt;true&lt;/create&gt;
 &lt;overwrite&gt;false&lt;/overwrite&gt;

 &lt;charset&gt;utf8&lt;/charset&gt;

 &lt;table&gt;

  &lt;name&gt;table1&lt;/name&gt;

  &lt;declaration&gt;

   &lt;field&gt;
    &lt;name&gt;id&lt;/name&gt;
    &lt;type&gt;integer&lt;/type&gt;
    &lt;default&gt;0&lt;/default&gt;
    &lt;notnull&gt;true&lt;/notnull&gt;
    &lt;autoincrement&gt;1&lt;/autoincrement&gt;
    &lt;unsigned&gt;true&lt;/unsigned&gt;
    &lt;length&gt;4&lt;/length&gt;
   &lt;/field&gt;

   &lt;field&gt;
    &lt;name&gt;fk&lt;/name&gt;
    &lt;type&gt;integer&lt;/type&gt;
    &lt;default&gt;0&lt;/default&gt;
    &lt;notnull&gt;true&lt;/notnull&gt;
    &lt;unsigned&gt;true&lt;/unsigned&gt;
    &lt;length&gt;4&lt;/length&gt;
   &lt;/field&gt;

   &lt;index&gt;
    &lt;name&gt;fk&lt;/name&gt;
    &lt;field&gt;
     &lt;name&gt;fk&lt;/name&gt;
     &lt;sorting&gt;ascending&lt;/sorting&gt;
    &lt;/field&gt;
   &lt;/index&gt;

   &lt;foreign&gt;
    &lt;name&gt;table1_ibfk_1&lt;/name&gt;
    &lt;match&gt;SIMPLE&lt;/match&gt;
    &lt;ondelete&gt;NO ACTION&lt;/ondelete&gt;
    &lt;onupdate&gt;NO ACTION&lt;/onupdate&gt;
    &lt;field&gt;fk&lt;/field&gt;
    &lt;references&gt;
     &lt;table&gt;table2&lt;/table&gt;
     &lt;field&gt;id&lt;/field&gt;
    &lt;/references&gt;
   &lt;/foreign&gt;

  &lt;/declaration&gt;

 &lt;/table&gt;

 &lt;table&gt;

  &lt;name&gt;table2&lt;/name&gt;

  &lt;declaration&gt;

   &lt;field&gt;
    &lt;name&gt;id&lt;/name&gt;
    &lt;type&gt;integer&lt;/type&gt;
    &lt;default&gt;0&lt;/default&gt;
    &lt;notnull&gt;true&lt;/notnull&gt;
    &lt;autoincrement&gt;1&lt;/autoincrement&gt;
    &lt;unsigned&gt;true&lt;/unsigned&gt;
    &lt;length&gt;4&lt;/length&gt;
   &lt;/field&gt;

   &lt;field&gt;
    &lt;name&gt;data&lt;/name&gt;
    &lt;type&gt;integer&lt;/type&gt;
    &lt;default&gt;&lt;/default&gt;
    &lt;notnull&gt;true&lt;/notnull&gt;
    &lt;length&gt;4&lt;/length&gt;
   &lt;/field&gt;

  &lt;/declaration&gt;

 &lt;/table&gt;

&lt;/database&gt;

Now i try to import it into a new table and receive an error. I added a sql-dump to show you the table in sql...

I think the problem is, that the fk is created before table2 even exists

Test script:
---------------
Script that i used to export the table:

$schema =&amp; MDB2_Schema::factory($dsn);

$dump_options = array (
	'output_mode' =&gt; 'file',
	'output' =&gt; 'schema.xml',
	'end_of_line' =&gt; &quot;\n&quot;
);

$definition = $schema-&gt;getDefinitionFromDatabase();
$op = $schema-&gt;dumpDatabase($definition, $dump_options, MDB2_SCHEMA_DUMP_ALL);
var_dump($op);

Script to import:

$schema =&amp; MDB2_Schema::factory($dsn);

$definition = $schema-&gt;parseDatabaseDefinitionFile('schema.xml');
$op = $schema-&gt;createDatabase($definition, array());
var_dump($op);

Expected result:
----------------
   true

Actual result:
--------------
   MDB2_Error

UserInfo: 
_doQuery: [Error message: Could not execute statement]
[Last executed query: ALTER TABLE table1 ADD CONSTRAINT table1_ibfk_1_idx FOREIGN KEY (fk) REFERENCES table2 (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION]
[Native code: 1005]
[Native message: Can't create table './test/#sql-4714_1c8.frm' (errno: 150)]</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by tacki
2009-02-09T11:25:44+00:00
PHP: 5.2.8 OS: Fedora Package Version: 

Description:
------------
   I exported a simple mysql table-layout with 1 foreign key:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?&gt;
&lt;database&gt;

 &lt;name&gt;test&lt;/name&gt;
 &lt;create&gt;true&lt;/create&gt;
 &lt;overwrite&gt;false&lt;/overwrite&gt;

 &lt;charset&gt;utf8&lt;/charset&gt;

 &lt;table&gt;

  &lt;name&gt;table1&lt;/name&gt;

  &lt;declaration&gt;

   &lt;field&gt;
    &lt;name&gt;id&lt;/name&gt;
    &lt;type&gt;integer&lt;/type&gt;
    &lt;default&gt;0&lt;/default&gt;
    &lt;notnull&gt;true&lt;/notnull&gt;
    &lt;autoincrement&gt;1&lt;/autoincrement&gt;
    &lt;unsigned&gt;true&lt;/unsigned&gt;
    &lt;length&gt;4&lt;/length&gt;
   &lt;/field&gt;

   &lt;field&gt;
    &lt;name&gt;fk&lt;/name&gt;
    &lt;type&gt;integer&lt;/type&gt;
    &lt;default&gt;0&lt;/default&gt;
    &lt;notnull&gt;true&lt;/notnull&gt;
    &lt;unsigned&gt;true&lt;/unsigned&gt;
    &lt;length&gt;4&lt;/length&gt;
   &lt;/field&gt;

   &lt;index&gt;
    &lt;name&gt;fk&lt;/name&gt;
    &lt;field&gt;
     &lt;name&gt;fk&lt;/name&gt;
     &lt;sorting&gt;ascending&lt;/sorting&gt;
    &lt;/field&gt;
   &lt;/index&gt;

   &lt;foreign&gt;
    &lt;name&gt;table1_ibfk_1&lt;/name&gt;
    &lt;match&gt;SIMPLE&lt;/match&gt;
    &lt;ondelete&gt;NO ACTION&lt;/ondelete&gt;
    &lt;onupdate&gt;NO ACTION&lt;/onupdate&gt;
    &lt;field&gt;fk&lt;/field&gt;
    &lt;references&gt;
     &lt;table&gt;table2&lt;/table&gt;
     &lt;field&gt;id&lt;/field&gt;
    &lt;/references&gt;
   &lt;/foreign&gt;

  &lt;/declaration&gt;

 &lt;/table&gt;

 &lt;table&gt;

  &lt;name&gt;table2&lt;/name&gt;

  &lt;declaration&gt;

   &lt;field&gt;
    &lt;name&gt;id&lt;/name&gt;
    &lt;type&gt;integer&lt;/type&gt;
    &lt;default&gt;0&lt;/default&gt;
    &lt;notnull&gt;true&lt;/notnull&gt;
    &lt;autoincrement&gt;1&lt;/autoincrement&gt;
    &lt;unsigned&gt;true&lt;/unsigned&gt;
    &lt;length&gt;4&lt;/length&gt;
   &lt;/field&gt;

   &lt;field&gt;
    &lt;name&gt;data&lt;/name&gt;
    &lt;type&gt;integer&lt;/type&gt;
    &lt;default&gt;&lt;/default&gt;
    &lt;notnull&gt;true&lt;/notnull&gt;
    &lt;length&gt;4&lt;/length&gt;
   &lt;/field&gt;

  &lt;/declaration&gt;

 &lt;/table&gt;

&lt;/database&gt;

Now i try to import it into a new table and receive an error. I added a sql-dump to show you the table in sql...

I think the problem is, that the fk is created before table2 even exists

Test script:
---------------
Script that i used to export the table:

$schema =&amp; MDB2_Schema::factory($dsn);

$dump_options = array (
	'output_mode' =&gt; 'file',
	'output' =&gt; 'schema.xml',
	'end_of_line' =&gt; &quot;\n&quot;
);

$definition = $schema-&gt;getDefinitionFromDatabase();
$op = $schema-&gt;dumpDatabase($definition, $dump_options, MDB2_SCHEMA_DUMP_ALL);
var_dump($op);

Script to import:

$schema =&amp; MDB2_Schema::factory($dsn);

$definition = $schema-&gt;parseDatabaseDefinitionFile('schema.xml');
$op = $schema-&gt;createDatabase($definition, array());
var_dump($op);

Expected result:
----------------
   true

Actual result:
--------------
   MDB2_Error

UserInfo: 
_doQuery: [Error message: Could not execute statement]
[Last executed query: ALTER TABLE table1 ADD CONSTRAINT table1_ibfk_1_idx FOREIGN KEY (fk) REFERENCES table2 (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION]
[Native code: 1005]
[Native message: Can't create table './test/#sql-4714_1c8.frm' (errno: 150)]</pre>]]></description>
      <dc:date>2009-02-22T20:46:56+00:00</dc:date>
      <dc:creator>g42 &amp;#x61;&amp;#116; gmx &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>MDB2_Schema Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15276">
      <title>MDB2_Schema: Bug 15276 [Open] Upgrading setting NOT NULL column default value to NULL</title>
      <link>http://pear.php.net/bugs/15276</link>
      <content:encoded><![CDATA[<pre>MDB2_Schema Bug
Reported by yunosh
2008-12-09T09:58:00+00:00
PHP: Irrelevant OS:  Package Version: CVS

Description:
------------
If during a field update the default value is no longer set, the default value is set to NULL. When this happens, a check is missing whether this is allowed at all. The attached patch fixes this.
Alternatively this check might happen where the actual update query is build.</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Schema Bug
Reported by yunosh
2008-12-09T09:58:00+00:00
PHP: Irrelevant OS:  Package Version: CVS

Description:
------------
If during a field update the default value is no longer set, the default value is set to NULL. When this happens, a check is missing whether this is allowed at all. The attached patch fixes this.
Alternatively this check might happen where the actual update query is build.</pre>]]></description>
      <dc:date>2009-08-25T07:00:56+00:00</dc:date>
      <dc:creator>jan &amp;#x61;&amp;#116; horde &amp;#x64;&amp;#111;&amp;#x74; org</dc:creator>
      <dc:subject>MDB2_Schema Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15189">
      <title>MDB2_Schema: Documentation Problem 15189 [Open] Some missing documentation for methods</title>
      <link>http://pear.php.net/bugs/15189</link>
      <content:encoded><![CDATA[<pre>MDB2_Schema Documentation Problem
Reported by doconnor
2008-11-29T22:15:24+00:00
PHP: 5.2.6 OS:  Package Version: CVS

Description:
------------
In particular, Writer, Parser, Parser2, Validate, etc have a few undocumented methods.

This blocks Request #15064 slightly</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Schema Documentation Problem
Reported by doconnor
2008-11-29T22:15:24+00:00
PHP: 5.2.6 OS:  Package Version: CVS

Description:
------------
In particular, Writer, Parser, Parser2, Validate, etc have a few undocumented methods.

This blocks Request #15064 slightly</pre>]]></description>
      <dc:date>2008-11-29T22:15:24+00:00</dc:date>
      <dc:creator>daniel &amp;#x64;&amp;#111;&amp;#x74; oconnor &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2_Schema Documentation Problem</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15064">
      <title>MDB2_Schema: Feature/Change Request 15064 [Open] Improve PHPCS results?</title>
      <link>http://pear.php.net/bugs/15064</link>
      <content:encoded><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by doconnor
2008-11-18T01:47:08+00:00
PHP: 5.2.6 OS:  Package Version: CVS

Description:
------------
When I run PHPCS locally over it; I get:
A TOTAL OF 473 ERROR(S) AND 659 WARNING(S) WERE FOUND IN 12 FILE(S)

See also:
http://pear.cweiske.de/codingstandards/MDB2_Schema

Test script:
---------------
clockwerx@clockwerx-desktop:~/pear/MDB2_Schema/MDB2$ phpcs --report=summary .


Actual result:
--------------
clockwerx@clockwerx-desktop:~/pear/MDB2_Schema/MDB2$ phpcs --report=summary .

PHP CODE SNIFFER REPORT SUMMARY
--------------------------------------------------------------------------------
FILE                                                            ERRORS  WARNINGS
--------------------------------------------------------------------------------
...e/clockwerx/pear/MDB2_Schema/MDB2/Schema/Reserved/mssql.php  1       0
/home/clockwerx/pear/MDB2_Schema/MDB2/Schema/Reserved/oci8.php  1       0
...e/clockwerx/pear/MDB2_Schema/MDB2/Schema/Reserved/mysql.php  1       0
...e/clockwerx/pear/MDB2_Schema/MDB2/Schema/Reserved/ibase.php  1       0
...e/clockwerx/pear/MDB2_Schema/MDB2/Schema/Reserved/pgsql.php  1       0
/home/clockwerx/pear/MDB2_Schema/MDB2/Schema/Tool.php           10      9
...rx/pear/MDB2_Schema/MDB2/Schema/Tool/ParameterException.php  4       0
/home/clockwerx/pear/MDB2_Schema/MDB2/Schema/Parser2.php        42      49
/home/clockwerx/pear/MDB2_Schema/MDB2/Schema/Writer.php         54      143
/home/clockwerx/pear/MDB2_Schema/MDB2/Schema/Validate.php       71      48
/home/clockwerx/pear/MDB2_Schema/MDB2/Schema/Parser.php         12      139
/home/clockwerx/pear/MDB2_Schema/MDB2/Schema.php                275     271
--------------------------------------------------------------------------------
A TOTAL OF 473 ERROR(S) AND 659 WARNING(S) WERE FOUND IN 12 FILE(S)
--------------------------------------------------------------------------------</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by doconnor
2008-11-18T01:47:08+00:00
PHP: 5.2.6 OS:  Package Version: CVS

Description:
------------
When I run PHPCS locally over it; I get:
A TOTAL OF 473 ERROR(S) AND 659 WARNING(S) WERE FOUND IN 12 FILE(S)

See also:
http://pear.cweiske.de/codingstandards/MDB2_Schema

Test script:
---------------
clockwerx@clockwerx-desktop:~/pear/MDB2_Schema/MDB2$ phpcs --report=summary .


Actual result:
--------------
clockwerx@clockwerx-desktop:~/pear/MDB2_Schema/MDB2$ phpcs --report=summary .

PHP CODE SNIFFER REPORT SUMMARY
--------------------------------------------------------------------------------
FILE                                                            ERRORS  WARNINGS
--------------------------------------------------------------------------------
...e/clockwerx/pear/MDB2_Schema/MDB2/Schema/Reserved/mssql.php  1       0
/home/clockwerx/pear/MDB2_Schema/MDB2/Schema/Reserved/oci8.php  1       0
...e/clockwerx/pear/MDB2_Schema/MDB2/Schema/Reserved/mysql.php  1       0
...e/clockwerx/pear/MDB2_Schema/MDB2/Schema/Reserved/ibase.php  1       0
...e/clockwerx/pear/MDB2_Schema/MDB2/Schema/Reserved/pgsql.php  1       0
/home/clockwerx/pear/MDB2_Schema/MDB2/Schema/Tool.php           10      9
...rx/pear/MDB2_Schema/MDB2/Schema/Tool/ParameterException.php  4       0
/home/clockwerx/pear/MDB2_Schema/MDB2/Schema/Parser2.php        42      49
/home/clockwerx/pear/MDB2_Schema/MDB2/Schema/Writer.php         54      143
/home/clockwerx/pear/MDB2_Schema/MDB2/Schema/Validate.php       71      48
/home/clockwerx/pear/MDB2_Schema/MDB2/Schema/Parser.php         12      139
/home/clockwerx/pear/MDB2_Schema/MDB2/Schema.php                275     271
--------------------------------------------------------------------------------
A TOTAL OF 473 ERROR(S) AND 659 WARNING(S) WERE FOUND IN 12 FILE(S)
--------------------------------------------------------------------------------</pre>]]></description>
      <dc:date>2008-11-18T01:47:08+00:00</dc:date>
      <dc:creator>daniel &amp;#x64;&amp;#111;&amp;#x74; oconnor &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2_Schema Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14985">
      <title>MDB2_Schema: Feature/Change Request 14985 [Open] Problems with atomic index updates</title>
      <link>http://pear.php.net/bugs/14985</link>
      <content:encoded><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by yunosh
2008-11-10T10:26:24+00:00
PHP: Irrelevant OS:  Package Version: 0.8.2

Description:
------------
Indexes are updated in one step when updating database schemas. This leads to problems because both, changing column definitions before, or after the indexes might not work.
One example: updating column widths might exceed the maximum index length of 1000 in MySQL, even though an index update would eliminate that index at a later step.
Thus, index updates should be split up, all changed/deleted indexes should be removed first, then the columns should be updated, then changed/added indexes should be added.</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by yunosh
2008-11-10T10:26:24+00:00
PHP: Irrelevant OS:  Package Version: 0.8.2

Description:
------------
Indexes are updated in one step when updating database schemas. This leads to problems because both, changing column definitions before, or after the indexes might not work.
One example: updating column widths might exceed the maximum index length of 1000 in MySQL, even though an index update would eliminate that index at a later step.
Thus, index updates should be split up, all changed/deleted indexes should be removed first, then the columns should be updated, then changed/added indexes should be added.</pre>]]></description>
      <dc:date>2008-11-15T13:52:50+00:00</dc:date>
      <dc:creator>jan &amp;#x61;&amp;#116; horde &amp;#x64;&amp;#111;&amp;#x74; org</dc:creator>
      <dc:subject>MDB2_Schema Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13779">
      <title>MDB2_Schema: Feature/Change Request 13779 [Assigned] Cannot pass createTable options on alterDatabaseTables</title>
      <link>http://pear.php.net/bugs/13779</link>
      <content:encoded><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by onokazu
2008-04-26T13:04:53+00:00
PHP: 4.4.8 OS: OSX Package Version: 0.8.2

Description:
------------
When alterDatabaseTables() is called through updateDatabase(), there is 
not way to pass createTable() options such as type, charset. There 
should be an optional parameter in updateDatabase() method to pass in 
these option values.</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by onokazu
2008-04-26T13:04:53+00:00
PHP: 4.4.8 OS: OSX Package Version: 0.8.2

Description:
------------
When alterDatabaseTables() is called through updateDatabase(), there is 
not way to pass createTable() options such as type, charset. There 
should be an optional parameter in updateDatabase() method to pass in 
these option values.</pre>]]></description>
      <dc:date>2008-10-24T20:02:36+00:00</dc:date>
      <dc:creator>onokazu &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2_Schema Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13544">
      <title>MDB2_Schema: Feature/Change Request 13544 [Open] Default Timestamp Problems</title>
      <link>http://pear.php.net/bugs/13544</link>
      <content:encoded><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by tacki
2008-03-31T06:53:28+00:00
PHP: 5.2.5 OS: Fedora Core 8 Package Version: 0.8.2

Description:
------------
I don't know if this is a Problem of MDB2_Schema or MDB2 itself. 

I'd like to dump a Database from Postgre 8.2.7 to a XML and then import it into a MySQL5-Server. MDB2-version is 2.4.1.

I run into Problems while exporting Tables with Timestamp-values:

1. Problem - A Timestamp-Field must have a default Value. That's ok, i used '1970-01-01 00:00:00' for this field and exported the DB.

2. Problem - I tried to import (with updateDatabase()) and got this failure:
_doQuery: [Error message: Could not execute statement] [Last executed query: ALTER TABLE timers CHANGE id id VARCHAR(64) DEFAULT ' ' NOT NULL, CHANGE completiontime completiontime DATETIME DEFAULT '\'1970-01-01 00:00:00\'::timestamp without time zone' NOT NULL] [Native code: 1067] [Native message: Invalid default value for 'completiontime'] 
Looks like MySQL doesn't understand the Postgre-Timestamp Handling, or this Value is not correctly handled by the MDB2-Postgre-Driver.

So if i use a defaultvalue, i'll run into Problems during the Import, and if i won't use a defaultvalue, i'll run into Problems during Export.

I changed the Validate.php to allow empty-values (which are then set to default '1970-01-01 00:00:00' by MDB2_Schema), but if i set a non-empty value at Postgres, i'll still get an Error, because the MDB2_MySQL-Driver can't handle it.

Test script:
---------------
1. Postgre-Tabledata:
CREATE TABLE timers
(
  id character varying(64) NOT NULL,
  completiontime timestamp without time zone NOT NULL DEFAULT '1970-01-01 00:00:00'::timestamp without time zone,
  CONSTRAINT timers_pkey_idx PRIMARY KEY (id)
)

2. Dump it to a XML with getDefinitionFromDatabase() and dumpDatabase()

3. Import the XML to a MySQL-Database with updateDatabase()

Expected result:
----------------
No Error Message

Actual result:
--------------
_doQuery: [Error message: Could not execute statement] [Last executed query: ALTER TABLE timers CHANGE id id VARCHAR(64) DEFAULT ' ' NOT NULL, CHANGE completiontime completiontime DATETIME DEFAULT '\'1970-01-01 00:00:00\'::timestamp without time zone' NOT NULL] [Native code: 1067] [Native message: Invalid default value for 'completiontime']</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by tacki
2008-03-31T06:53:28+00:00
PHP: 5.2.5 OS: Fedora Core 8 Package Version: 0.8.2

Description:
------------
I don't know if this is a Problem of MDB2_Schema or MDB2 itself. 

I'd like to dump a Database from Postgre 8.2.7 to a XML and then import it into a MySQL5-Server. MDB2-version is 2.4.1.

I run into Problems while exporting Tables with Timestamp-values:

1. Problem - A Timestamp-Field must have a default Value. That's ok, i used '1970-01-01 00:00:00' for this field and exported the DB.

2. Problem - I tried to import (with updateDatabase()) and got this failure:
_doQuery: [Error message: Could not execute statement] [Last executed query: ALTER TABLE timers CHANGE id id VARCHAR(64) DEFAULT ' ' NOT NULL, CHANGE completiontime completiontime DATETIME DEFAULT '\'1970-01-01 00:00:00\'::timestamp without time zone' NOT NULL] [Native code: 1067] [Native message: Invalid default value for 'completiontime'] 
Looks like MySQL doesn't understand the Postgre-Timestamp Handling, or this Value is not correctly handled by the MDB2-Postgre-Driver.

So if i use a defaultvalue, i'll run into Problems during the Import, and if i won't use a defaultvalue, i'll run into Problems during Export.

I changed the Validate.php to allow empty-values (which are then set to default '1970-01-01 00:00:00' by MDB2_Schema), but if i set a non-empty value at Postgres, i'll still get an Error, because the MDB2_MySQL-Driver can't handle it.

Test script:
---------------
1. Postgre-Tabledata:
CREATE TABLE timers
(
  id character varying(64) NOT NULL,
  completiontime timestamp without time zone NOT NULL DEFAULT '1970-01-01 00:00:00'::timestamp without time zone,
  CONSTRAINT timers_pkey_idx PRIMARY KEY (id)
)

2. Dump it to a XML with getDefinitionFromDatabase() and dumpDatabase()

3. Import the XML to a MySQL-Database with updateDatabase()

Expected result:
----------------
No Error Message

Actual result:
--------------
_doQuery: [Error message: Could not execute statement] [Last executed query: ALTER TABLE timers CHANGE id id VARCHAR(64) DEFAULT ' ' NOT NULL, CHANGE completiontime completiontime DATETIME DEFAULT '\'1970-01-01 00:00:00\'::timestamp without time zone' NOT NULL] [Native code: 1067] [Native message: Invalid default value for 'completiontime']</pre>]]></description>
      <dc:date>2008-03-31T06:53:28+00:00</dc:date>
      <dc:creator>g42 &amp;#x61;&amp;#116; gmx &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>MDB2_Schema Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12154">
      <title>MDB2_Schema: Feature/Change Request 12154 [Assigned] Multi-column primary key validation error</title>
      <link>http://pear.php.net/bugs/12154</link>
      <content:encoded><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by cadorn
2007-09-30T12:57:45+00:00
PHP: 5.2.1 OS: Mac OS X 10.4.10 Package Version: CVS

Description:
------------
I am trying to dump the schema of a wordpress database to an XML file as a test.

The dump fails with the following error:

there was already an primary index or autoincrement field in &quot;wp_options&quot; before &quot;PRIMARY&quot;

The schema of the wp_options table is as follows:

CREATE TABLE `wp_options` (
 `option_id` bigint(20) NOT NULL AUTO_INCREMENT,
 `blog_id` int(11) NOT NULL DEFAULT '0',
 `option_name` varchar(64) NOT NULL DEFAULT '',
 `option_can_override` enum('Y','N') NOT NULL DEFAULT 'Y',
 `option_type` int(11) NOT NULL DEFAULT '1',
 `option_value` longtext NOT NULL,
 `option_width` int(11) NOT NULL DEFAULT '20',
 `option_height` int(11) NOT NULL DEFAULT '8',
 `option_description` tinytext NOT NULL,
 `option_admin_level` int(11) NOT NULL DEFAULT '1',
 `autoload` enum('yes','no') NOT NULL DEFAULT 'yes',
 PRIMARY KEY (`option_id`,`blog_id`,`option_name`),
 KEY `option_name` (`option_name`)
) ENGINE=MyISAM AUTO_INCREMENT=119 DEFAULT CHARSET=utf8

Looks like the MDB2_Schema_Validator does not like the multi-column primary key? 

Test script:
---------------
require_once 'MDB2/Schema.php';

$dsn = 'mysql://root@localhost/WordPress';

$manager =&amp; MDB2_Schema::factory($dsn, array('parser' =&gt; 'MDB2_Schema_Parser2'));
if (MDB2::isError($manager)) { die($manager-&gt;getUserinfo()); }
print '&lt;h1&gt;Reverse Engineering Database&lt;/h1&gt;';
$def = $manager-&gt;getDefinitionFromDatabase();
print_r($def);
print '&lt;h1&gt;Dumping to XML&lt;/h1&gt;';
$oldxml = $manager-&gt;dumpDatabase($def, array('output_mode' =&gt; 'file','output' =&gt; 'dump.xml'), MDB2_SCHEMA_DUMP_STRUCTURE);
var_dump($oldxml);


Expected result:
----------------
The validation should pass and the schema should be dumped to the dump.xml file.

Actual result:
--------------
[0] =&gt; Array
                (
                    [file] =&gt; /pinf/packages/pear.MDB2_Schema/MDB2/Schema.php
                    [line] =&gt; 2617
                    [function] =&gt; PEAR_Error
                    [class] =&gt; PEAR_Error
                    [type] =&gt; -&gt;
                    [args] =&gt; Array
                        (
                            [0] =&gt; MDB2_Schema Error: schema validation error
                            [1] =&gt; -3
                            [2] =&gt; 1
                            [3] =&gt; 1024
                            [4] =&gt; there was already an primary index or autoincrement field in &quot;wp_options&quot; before &quot;primary&quot;
                        )

                )</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by cadorn
2007-09-30T12:57:45+00:00
PHP: 5.2.1 OS: Mac OS X 10.4.10 Package Version: CVS

Description:
------------
I am trying to dump the schema of a wordpress database to an XML file as a test.

The dump fails with the following error:

there was already an primary index or autoincrement field in &quot;wp_options&quot; before &quot;PRIMARY&quot;

The schema of the wp_options table is as follows:

CREATE TABLE `wp_options` (
 `option_id` bigint(20) NOT NULL AUTO_INCREMENT,
 `blog_id` int(11) NOT NULL DEFAULT '0',
 `option_name` varchar(64) NOT NULL DEFAULT '',
 `option_can_override` enum('Y','N') NOT NULL DEFAULT 'Y',
 `option_type` int(11) NOT NULL DEFAULT '1',
 `option_value` longtext NOT NULL,
 `option_width` int(11) NOT NULL DEFAULT '20',
 `option_height` int(11) NOT NULL DEFAULT '8',
 `option_description` tinytext NOT NULL,
 `option_admin_level` int(11) NOT NULL DEFAULT '1',
 `autoload` enum('yes','no') NOT NULL DEFAULT 'yes',
 PRIMARY KEY (`option_id`,`blog_id`,`option_name`),
 KEY `option_name` (`option_name`)
) ENGINE=MyISAM AUTO_INCREMENT=119 DEFAULT CHARSET=utf8

Looks like the MDB2_Schema_Validator does not like the multi-column primary key? 

Test script:
---------------
require_once 'MDB2/Schema.php';

$dsn = 'mysql://root@localhost/WordPress';

$manager =&amp; MDB2_Schema::factory($dsn, array('parser' =&gt; 'MDB2_Schema_Parser2'));
if (MDB2::isError($manager)) { die($manager-&gt;getUserinfo()); }
print '&lt;h1&gt;Reverse Engineering Database&lt;/h1&gt;';
$def = $manager-&gt;getDefinitionFromDatabase();
print_r($def);
print '&lt;h1&gt;Dumping to XML&lt;/h1&gt;';
$oldxml = $manager-&gt;dumpDatabase($def, array('output_mode' =&gt; 'file','output' =&gt; 'dump.xml'), MDB2_SCHEMA_DUMP_STRUCTURE);
var_dump($oldxml);


Expected result:
----------------
The validation should pass and the schema should be dumped to the dump.xml file.

Actual result:
--------------
[0] =&gt; Array
                (
                    [file] =&gt; /pinf/packages/pear.MDB2_Schema/MDB2/Schema.php
                    [line] =&gt; 2617
                    [function] =&gt; PEAR_Error
                    [class] =&gt; PEAR_Error
                    [type] =&gt; -&gt;
                    [args] =&gt; Array
                        (
                            [0] =&gt; MDB2_Schema Error: schema validation error
                            [1] =&gt; -3
                            [2] =&gt; 1
                            [3] =&gt; 1024
                            [4] =&gt; there was already an primary index or autoincrement field in &quot;wp_options&quot; before &quot;primary&quot;
                        )

                )</pre>]]></description>
      <dc:date>2008-10-24T20:22:43+00:00</dc:date>
      <dc:creator>christoph &amp;#x61;&amp;#116; christophdorn &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2_Schema Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/11961">
      <title>MDB2_Schema: Feature/Change Request 11961 [Assigned] Custom Field Type</title>
      <link>http://pear.php.net/bugs/11961</link>
      <content:encoded><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by ifeghali
2007-09-01T22:30:49+00:00
PHP: Irrelevant OS:  Package Version: CVS

Description:
------------
I would love to have the ability to add annotations, so that if a database is created in a particular DBMS, you can specify exactly what kind of field to create. for instance, the kind of TEXT or INT field that is created.

In the &lt;field&gt; tag, you could have:

&lt;customtype&gt;
   &lt;mysql&gt;BIGINT&lt;/mysql&gt;
&lt;/customtype&gt;

this would allow advanced users to customize exactly how the field is created on different DBMS. beginners or people who don't care could use the guesswork, which is good enough for that level.

the reverse engineering script would just spit out the tags for the current DBMS and version. this would allow us to customize for mysql 4.0/4.1/5.0 and so on. the goal is not to support everything - it would only spit out what the current dbms is, and the user can customize it if needed for other dbms

* Feature requested by Greg *</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by ifeghali
2007-09-01T22:30:49+00:00
PHP: Irrelevant OS:  Package Version: CVS

Description:
------------
I would love to have the ability to add annotations, so that if a database is created in a particular DBMS, you can specify exactly what kind of field to create. for instance, the kind of TEXT or INT field that is created.

In the &lt;field&gt; tag, you could have:

&lt;customtype&gt;
   &lt;mysql&gt;BIGINT&lt;/mysql&gt;
&lt;/customtype&gt;

this would allow advanced users to customize exactly how the field is created on different DBMS. beginners or people who don't care could use the guesswork, which is good enough for that level.

the reverse engineering script would just spit out the tags for the current DBMS and version. this would allow us to customize for mysql 4.0/4.1/5.0 and so on. the goal is not to support everything - it would only spit out what the current dbms is, and the user can customize it if needed for other dbms

* Feature requested by Greg *</pre>]]></description>
      <dc:date>2007-09-03T08:30:14+00:00</dc:date>
      <dc:creator>ifeghali &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>MDB2_Schema Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/11696">
      <title>MDB2_Schema: Bug 11696 [Open] getDefinitionFromDatabase() ends with ROLLBACK, without START TRANSACTION</title>
      <link>http://pear.php.net/bugs/11696</link>
      <content:encoded><![CDATA[<pre>MDB2_Schema Bug
Reported by floele
2007-07-28T08:19:18+00:00
PHP: Irrelevant OS: Irrelevant Package Version: CVS

Description:
------------
Hi once again ;)

I hope that I got an MDB2_Schema bug instead of an MDB2 one this time at least...

I recently submitted 11692 which already mentions my problem, but now I realised that this bug is in fact unrelated to it.

So what I am doing is thw following:

$db-&gt;supports('transactions') &amp;&amp; $db-&gt;beginTransaction();
$db-&gt;query(...);

$previous_schema = $schema-&gt;getDefinitionFromDatabase();
die(); // usually I'd continue with updateDatabase() and a few more queries and then commit it all together, but that won't work either so I have this for simplicity.

Interestingly, the query log shows a ROLLBACK at the bottom, without a START TRANSACTION at the beginning.
See: http://pastebin.ca/637004
I highlighted the important parts.

Expected result:
----------------
Either no ROLLBACK at the end, or a new nested transaction at the beginning.

Actual result:
--------------
ROLLBACK at the end, without starting a new transaction.</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Schema Bug
Reported by floele
2007-07-28T08:19:18+00:00
PHP: Irrelevant OS: Irrelevant Package Version: CVS

Description:
------------
Hi once again ;)

I hope that I got an MDB2_Schema bug instead of an MDB2 one this time at least...

I recently submitted 11692 which already mentions my problem, but now I realised that this bug is in fact unrelated to it.

So what I am doing is thw following:

$db-&gt;supports('transactions') &amp;&amp; $db-&gt;beginTransaction();
$db-&gt;query(...);

$previous_schema = $schema-&gt;getDefinitionFromDatabase();
die(); // usually I'd continue with updateDatabase() and a few more queries and then commit it all together, but that won't work either so I have this for simplicity.

Interestingly, the query log shows a ROLLBACK at the bottom, without a START TRANSACTION at the beginning.
See: http://pastebin.ca/637004
I highlighted the important parts.

Expected result:
----------------
Either no ROLLBACK at the end, or a new nested transaction at the beginning.

Actual result:
--------------
ROLLBACK at the end, without starting a new transaction.</pre>]]></description>
      <dc:date>2008-03-10T16:40:39+00:00</dc:date>
      <dc:creator>floele &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2_Schema Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/10122">
      <title>MDB2_Schema: Feature/Change Request 10122 [Assigned] xinclude in schema files</title>
      <link>http://pear.php.net/bugs/10122</link>
      <content:encoded><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by armen
2007-02-19T02:45:59+00:00
PHP: Irrelevant OS:  Package Version: 0.7.0

Description:
------------
It's better to give an example here. Let's say we have two initialization schema files. As MDB_Schema parser forces to have &lt;declaration&gt; in the &lt;table&gt; so we need to write declaration section in each file and it will cause duplication. This problem could be solved with an additional file containing the declaration section and including it in initialization files.</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by armen
2007-02-19T02:45:59+00:00
PHP: Irrelevant OS:  Package Version: 0.7.0

Description:
------------
It's better to give an example here. Let's say we have two initialization schema files. As MDB_Schema parser forces to have &lt;declaration&gt; in the &lt;table&gt; so we need to write declaration section in each file and it will cause duplication. This problem could be solved with an additional file containing the declaration section and including it in initialization files.</pre>]]></description>
      <dc:date>2007-02-26T12:06:00+00:00</dc:date>
      <dc:creator>tuxmaster &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2_Schema Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/9452">
      <title>MDB2_Schema: Feature/Change Request 9452 [Open] Table charset, collation, engine options</title>
      <link>http://pear.php.net/bugs/9452</link>
      <content:encoded><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by pearbugs2006@...
2006-11-25T02:47:48+00:00
PHP: 5.1.2 OS: Ubuntu 6.0 Package Version: 0.7.0

Description:
------------
I'm using MDB2_Schema with MySQL but as I'm creating an internationalized app I need to make sure I've got utf8 tables.  Right now MDB2_Schema just uses the defaults.  I simply rewrote Schema.php to always set utf8 when it creates a table, but it seems like this is an important feature to add.  In my case I wouldn't need to set each table individually, I'm using the same settings through the entire database.</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by pearbugs2006@...
2006-11-25T02:47:48+00:00
PHP: 5.1.2 OS: Ubuntu 6.0 Package Version: 0.7.0

Description:
------------
I'm using MDB2_Schema with MySQL but as I'm creating an internationalized app I need to make sure I've got utf8 tables.  Right now MDB2_Schema just uses the defaults.  I simply rewrote Schema.php to always set utf8 when it creates a table, but it seems like this is an important feature to add.  In my case I wouldn't need to set each table individually, I'm using the same settings through the entire database.</pre>]]></description>
      <dc:date>2007-06-10T18:44:14+00:00</dc:date>
      <dc:creator>pearbugs2006 &amp;#x61;&amp;#116; reddreamer &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2_Schema Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/8645">
      <title>MDB2_Schema: Feature/Change Request 8645 [Open] Add support for Views</title>
      <link>http://pear.php.net/bugs/8645</link>
      <content:encoded><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by joeboe@...
2006-09-06T16:40:39+00:00
PHP: 5.1.6 OS: N/A Package Version: 0.6.0

Description:
------------
We would like to use MDB2_Schema to help manage changes on the dev db's when pushing to beta and live stages.  We use views in MySQL 5, which MDB2 seems to ignore.  It would be nice to see this added.</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by joeboe@...
2006-09-06T16:40:39+00:00
PHP: 5.1.6 OS: N/A Package Version: 0.6.0

Description:
------------
We would like to use MDB2_Schema to help manage changes on the dev db's when pushing to beta and live stages.  We use views in MySQL 5, which MDB2 seems to ignore.  It would be nice to see this added.</pre>]]></description>
      <dc:date>2006-09-07T08:35:55+00:00</dc:date>
      <dc:creator>joeboe &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2_Schema Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/8075">
      <title>MDB2_Schema: Feature/Change Request 8075 [Open] FULLTEXT Support</title>
      <link>http://pear.php.net/bugs/8075</link>
      <content:encoded><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by michael@...
2006-06-29T10:52:35+00:00
PHP: 5.1.4 OS: irrelevant Package Version: 0.5.0

Description:
------------
It would be really cool if schema support fulltext indexes for MySQL (and equivalent for other RDBMSs)

Thanks!

Michael</pre>]]></content:encoded>
      <description><![CDATA[<pre>MDB2_Schema Feature/Change Request
Reported by michael@...
2006-06-29T10:52:35+00:00
PHP: 5.1.4 OS: irrelevant Package Version: 0.5.0

Description:
------------
It would be really cool if schema support fulltext indexes for MySQL (and equivalent for other RDBMSs)

Thanks!

Michael</pre>]]></description>
      <dc:date>2006-06-29T10:52:35+00:00</dc:date>
      <dc:creator>michael &amp;#x61;&amp;#116; apison &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>MDB2_Schema Feature/Change Request</dc:subject>
    </item>
</rdf:RDF>
