Subject: | Patch for mysql 5.5 |
Attached is a patch which makes deploys work in MySQL 5.5 and later. The
syntax of create table changed between 5.0 and 5.5 to remove support for
the TYPE clause, replaced with ENGINE.
Best regards,
Dave Lambley
Subject: | mysql_55.patch |
Index: lib/Tangram/Relational/Engine.pm
===================================================================
--- lib/Tangram/Relational/Engine.pm (revision 34980)
+++ lib/Tangram/Relational/Engine.pm (revision 34981)
@@ -429,6 +429,11 @@
my $do = _deploy_do($output);
+ my $TYPE = "TYPE";
+ if ($output->{mysql_serverversion} && $output->{mysql_serverversion} > 50000) {
+ $TYPE = "ENGINE";
+ }
+
foreach my $table (sort keys %$tables)
{
my $def = $tables->{$table};
@@ -466,7 +471,7 @@
? ("PRIMARY KEY( $id_col )")
: () ),
),
- "\n) ".($type?" TYPE=$type":""));
+ "\n) ".($type?" $TYPE=$type":""));
}
@@ -488,7 +493,7 @@
unless $made_sequence{$sequence}++;
} else {
- $do->( <<SQL . ($table_type?" TYPE=$table_type":"") );
+ $do->( <<SQL . ($table_type?" $TYPE=$table_type":"") );
CREATE TABLE $control
(
layout INTEGER NOT NULL,