We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21299
    • 0 Posts
    Hello,
    I’ am trying creating a model with a MyISAM table and an InnoDB table using the following schema.

    <?xml version="1.0" encoding="UTF-8"?>
    <model package="test" baseClass="xPDOObject" platform="mysql" defaultEngine="MyIsam" version="1.1" >
        <object class="Link" table="links" engine="InnoDB" extends="xPDOSimpleObject" >
            <field key="url" dbtype="varchar" precision="2083" phptype="string" null="false" default="" />
            <index alias="URL" name="URL"  primary="false" unique="false" type="HASH">
                <column key="url" collation="A" null="false" />
            </index>
            <composite alias="Linkdetail" class="Linkdetail" local="id" foreign="id" cardinality="one" owner="local" />
        </object>
        <object class="Linkdetail" table="linksdetails" extends="xPDOSimpleObject " >
            <field key="decription" dbtype="text" phptype="string" null="true" />
            <aggregate alias="Link" class="Link" local="id" foreign="id" cardinality="one" owner="foreign" />
        </object>
    </model>
    


    Trying to create the model with parseSchema and the DB tables with createObjectContainer ignores the InnoDB engines. Even when I changed the defaultEngine to InnoDB the engine remained MyISAM. Every time I tried I get a message like this:

    [tt][2011-05-08 22:28:19] (INFO @ /test/index.php)

    Created table `ft_links`
    SQL: CREATE TABLE `ft_links` (`id` INTEGER unsigned NOT NULL AUTO_INCREMENT, `url` VARCHAR(2083) NOT NULL DEFAULT ’’, PRIMARY KEY (`id`), INDEX `URL` (`url`)) ENGINE=MyISAM

    [2011-05-08 22:28:19] (INFO @ /test/index.php)

    Created table `ft_linksdetails`
    SQL: CREATE TABLE `ft_linksdetails` (`id` INTEGER unsigned NOT NULL AUTO_INCREMENT, `decription` TEXT NULL, PRIMARY KEY (`id`)) ENGINE=MyISAM
    [/tt]
    I am using xPDO 2.1.3-pl
      • 22303 MODX Staff
      • 10,725 Posts
      This appears to be an error in xPDOGenerator::parseSchema() which is not adding the engine attribute to the table metadata in the map file. Bug #4682.
        • 21299
        • 0 Posts
        Does it only affect table metadata? For instance I declared the index type as HASH (even though hash indexes are not supported by InnoDB engine).
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: nevang at May 09, 2011, 11:43 AM

          Does it only affect table metadata? For instance I declared the index type as HASH (even though hash indexes are not supported by InnoDB engine).
          Yes, this bug only affects attributes of the object element other than class, table, and extends — validation of index types against engine types in MySQL is not currently attempted by xPDO. You’ll have to test table and index creation, validating the results for yourself to make sure it is created properly.