cftransaction 不回滚错误时创建表

cftransaction not rolling back create tables on error

所以这可能只是我对 cftransaction 标签理解的根本性错误。

我有一堆 Create Table SQL 语句,一个接一个,其中一个有错误,它们被包裹在一个巨大的 cftransaction 中,但是当错误发生时,它不会回滚创建语句。

<cfset variables.x = 0>
<cftry>
<cftransaction action="begin">
    <cfquery name="variables.qTables" datasource="dev_db">
        CREATE  TABLE  `dev_db`.`tbl_entries_import` (  
            `p_id` int( 11  )  default NULL ,
            `p_Title` varchar( 255  )  default NULL ,
            `p_FirstName` varchar( 255  )  default NULL ,
            `p_unique_email` varchar( 255  )  default NULL ,
            PRIMARY  KEY (  `p_ID`  ),
            UNIQUE KEY `p_unique_email_UNIQUE` (`p_unique_email`)
          ) ENGINE  = InnoDB  DEFAULT CHARSET  = utf8;
    </cfquery>
    <cfset variables.x++>
    <cftransaction action="setsavepoint" savepoint="#variables.x#"/>

    <cfquery name="variables.qTables" datasource="dev_db">
        CREATE  TABLE  `dev_db`.`tbl_entry2office_import` (  
            `entryID` int( 11  )  NOT  NULL default  '0',
            `officeID` int( 11  )  NOT  NULL default  '0'
            PRIMARY  KEY (  `entryID`  ) 
        ) ENGINE  = InnoDB  DEFAULT CHARSET  = utf8 COLLATE  = utf8_unicode_ci;
    </cfquery>
    <cfset variables.x++>
    <cftransaction action="setsavepoint" savepoint="#variables.x#"/>
</cftransaction>
<cfcatch>
    <cfloop from="#variables.x#" to="1" index="variables.y" step="-1">
        <cftransaction action="rollback" savepoint="#variables.y#">
    </cfloop>
    <cfdump var="#cfcatch#">
</cfcatch>
</cftry>

所以在第二个 cfquery 之后(应该会导致错误),我希望第一个 cfquery 中的 table 不存在于我的模式中,但目前它会做。

根据文档,

CREATE TABLE 语句会导致隐式提交:“13.3.3 Statements That Cause an Implicit Commit”:

The statements listed in this section (and any synonyms for them) implicitly end any transaction active in the current session, as if you had done a COMMIT before executing the statement.

Data definition language (DDL) statements that define or modify database objects. ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME, ALTER EVENT, ALTER PROCEDURE, ALTER SERVER, ALTER TABLE, CREATE DATABASE, CREATE EVENT, CREATE INDEX, CREATE PROCEDURE, CREATE SERVER, CREATE TABLE, DROP DATABASE, DROP EVENT, DROP INDEX, DROP PROCEDURE, DROP SERVER, DROP TABLE, RENAME TABLE, TRUNCATE TABLE.

(我的重点