MySQL 3.23 ENGINE must be TYPE in table creation
Page: 1
Torgny Bjers
on Jul 23. 2006. 2:51 pm
Hello,
I just discovered a little bug in the installation script. I've included a fix for this below.
In Mysql prior to v4 (3.23), you MUST use "TYPE = " instead of "ENGINE = ".
top of install/installation/templates/sql/mysql_schema.php:
<?php
$compatType = 'ENGINE';
// Determine MySQL version.
$mysqlInfo = mysql_get_server_info();
if (is_string($mysqlInfo))
{
if (version_compare($mysqlInfo, '4.0') == -1)
{
$compatType = 'TYPE';
}
}
?>
Then replace every instance of "ENGINE=" with:
<?php echo $compatType; ?>=
Regards,
Torgny
I just discovered a little bug in the installation script. I've included a fix for this below.
In Mysql prior to v4 (3.23), you MUST use "TYPE = " instead of "ENGINE = ".
top of install/installation/templates/sql/mysql_schema.php:
<?php
$compatType = 'ENGINE';
// Determine MySQL version.
$mysqlInfo = mysql_get_server_info();
if (is_string($mysqlInfo))
{
if (version_compare($mysqlInfo, '4.0') == -1)
{
$compatType = 'TYPE';
}
}
?>
Then replace every instance of "ENGINE=" with:
<?php echo $compatType; ?>=
Regards,
Torgny
Torgny Bjers
on Jul 23. 2006. 3:19 pm
The above results in the tables being created, but the initial information is not put into the database because in MySQL 3.23.58 the method executeMultipleQueries returns null/false or something, and that makes the code actually abort.
My fixes can be found here:
http://www.bjers.biz/FinishStep.tar.gz
Please consider this alteration and I am sure you can improve upon it, but that's what I did to fix my installation with MySQL 3.23.58.
Warm Regards,
Torgny
My fixes can be found here:
http://www.bjers.biz/FinishStep.tar.gz
Please consider this alteration and I am sure you can improve upon it, but that's what I did to fix my installation with MySQL 3.23.58.
Warm Regards,
Torgny
Torgny Bjers
on Jul 24. 2006. 1:52 pm
In MySQL 4.1.2 you can use SHOW ENGINE InnoDB; or SHOW ENGINES; for older versions of MySQL you'll have to use SHOW TABLE TYPES;
SHOW TABLE TYPES returns the following in my MySQL 5.x:
mysql> SHOW TABLE TYPES;
12 rows in set, 1 warning (0.00 sec)
Which is the same as what a 3.23.x would return, only that 5.x signals a warning (probably since show table types is in fact deprecated).
SHOW TABLE TYPES returns the following in my MySQL 5.x:
mysql> SHOW TABLE TYPES;
+------------+---------+----------------------------------------------------------------+ | Engine | Support | Comment | +------------+---------+----------------------------------------------------------------+ | MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | | InnoDB | YES | Supports transactions, row-level locking, and foreign keys | | BerkeleyDB | YES | Supports transactions and page-level locking | | BLACKHOLE | NO | /dev/null storage engine (anything you write to it disappears) | | EXAMPLE | NO | Example storage engine | | ARCHIVE | NO | Archive storage engine | | CSV | NO | CSV storage engine | | ndbcluster | NO | Clustered, fault-tolerant, memory-based tables | | FEDERATED | NO | Federated MySQL storage engine | | MRG_MYISAM | YES | Collection of identical MyISAM tables | | ISAM | NO | Obsolete storage engine | +------------+---------+----------------------------------------------------------------+
12 rows in set, 1 warning (0.00 sec)
Which is the same as what a 3.23.x would return, only that 5.x signals a warning (probably since show table types is in fact deprecated).
Torgny Bjers
on Jul 24. 2006. 2:14 pm
I'm glad I could help. If you need anything else, just give me a holler!
Topic is locked. If you have something important to say about issues discussed on this page please write at hi@a51dev.com.



