View Issue Details

IDProjectCategoryView StatusLast Update
0000838OXID eShop (all versions)2. ----- eShop backend (admin) -----public2012-12-10 14:22
Reporterdainius.bigelis Assigned To 
PriorityhighSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
Fixed in Version4.1.2 revision 18998 
Summary0000838: "Could not create HEAP Table" occurs during Product Export
DescriptionTried to export the products from the CE (UTF8 shop) using the: Core Settings => Service => Product Export.
When selected all categories and clicked "Start Export" - got the error at the top of the page:
Could not create HEAP Table tmp_e23a22fa67b446ed1da67c63c176dff5
Additional InformationOn EE this error not occurs.
TagsExport, Import
Theme
BrowserAll
PHP Version5.2.6
Database Version5.0.33

Activities

dainius.bigelis

2009-04-28 14:41

reporter   ~0000817

See here:
https://www.oxid-esales.com/de/resources/forum/novichkam-newbies/kak-importirovat

Looks like the problem is in the sql, where charsets not coincides:

2009-04-18 12:41:29exception 'ADODB_Exception' with message 'mysql error: [1253: COLLATION 'latin1_general_ci' is not valid for CHARACTER SET 'utf8'] in EXECUTE("CREATE TABLE if not exists tmp_cb4d4dcac93df291128b79261c8fe ( oxid char(32) NOT NULL default '' ) TYPE=HEAP DEFAULT CHARACTER SET utf8 COLLATE latin1_general_ci")
' in W:\home\oxid\www\core\adodblite\adodb-exceptions.inc.php:84
Stack trace:
#0 W:\home\oxid\www\core\adodblite\adodbSQL_drivers\mysql\mysql_driver.inc(369): adodb_throw('mysql', 'EXECUTE', 1253, 'COLLATION 'lati...', 'CREATE TABLE if...', false, Object(object_ADOConnection))
#1 W:\home\oxid\www\core\adodblite\adodb.inc.php(316): mysql_driver_ADOConnection->do_query('CREATE TABLE if...', -1, -1, false)
#2 W:\home\oxid\www\core\adodblite\adodb-perf.inc.php(77): ADOConnection->Execute('CREATE TABLE if...', false)
#3 W:\home\oxid\www\core\adodblite\adodb.inc.php(313): adodb_log_sql(Object(object_ADOConnection), 'CREATE TABLE if...', false)
#4 W:\home\oxid\www\admin\dynexportbase.php(578): ADOConnection->Execute('CREATE TABLE if...')
#5 W:\home\oxid\www\admin\dynexportbase.php(422): DynExportBase->_createHeapTable('tmp_cb4d4dcac93...', 'DEFAULT CHARACT...')
#6 W:\home\oxid\www\admin\dynexportbase.php(143): DynExportBase->prepareExport()
#7 W:\home\oxid\www\views\oxview.php(466): DynExportBase->start()
#8 W:\home\oxid\www\views\oxshopcontrol.php(255): oxView->executeFunction('start')
#9 W:\home\oxid\www\views\oxshopcontrol.php(85): oxShopControl->_process('genExport_do', 'start')
#10 W:\home\oxid\www\index.php(105): oxShopControl->start()
0000011 W:\home\oxid\www\admin\index.php(39): require_once('W:\home\oxid\ww...')
0000012 {main}

arvydas_vapsva

2009-04-28 16:58

reporter   ~0000820

problem in dynexportbase::_generateTableCharSet() method, which incorrectly returns charset and collation info. correct method looks like this:

    private function _generateTableCharSet($sMysqlVersion)
    {
        $oDB = oxDb::getDb(true);

        //if MySQL >= 4.1.0 set charsets and collations
        if (version_compare($sMysqlVersion, '4.1.0', '>=')>0) {
            $sMysqlCharacterSet = null;
            $sMysqlCollation = null;
            $rs = $oDB->execute( "SHOW FULL COLUMNS FROM `oxarticles` WHERE field like 'OXID'" );
            if ( isset( $rs->fields['Collation'] ) && ( $sMysqlCollation = $rs->fields['Collation'] ) ) {
                $rs = $oDB->execute( "SHOW COLLATION LIKE '{$sMysqlCollation}'" );
                if ( isset( $rs->fields['Charset'] ) ) {
                    $sMysqlCharacterSet = $rs->fields['Charset'];
                }
            }

            if ( $sMysqlCollation && $sMysqlCharacterSet ) {
                $sTableCharset = "DEFAULT CHARACTER SET ".$sMysqlCharacterSet." COLLATE ".$sMysqlCollation;
            } else {
                $sTableCharset = "";
            }
        } else {
            $sTableCharset = "";
        }
        return $sTableCharset;
    }