interchange / interchange6-schema

DBIC schema for Interchange 6
8 stars 7 forks source link

FreeBSD mysql 5.6.22 smoker fail (was: Invalid default value for 'public in reviews) #149

Closed racke closed 9 years ago

racke commented 9 years ago

http://www.cpantesters.org/cpan/report/921ffe4e-8a09-11e4-a19c-5e32e0bfc7aa

Use of uninitialized value $mysql_ver in numeric lt (<) at /usr/perl5.20.0/lib/site_perl/5.20.0/DBIx/Class/Storage/DBI/mysql.pm line 117.
DBIx::Class::Storage::DBI::catch {...} (): DBIx::Class::Storage::DBI::try {...} (): DBI Exception: DBD::mysql::db do failed: Invalid default value for 'public' [for Statement "CREATE TABLE `reviews` (
  `reviews_id` integer NOT NULL auto_increment,
  `sku` varchar(64) NOT NULL,
  `title` varchar(255) NOT NULL DEFAULT '',
  `content` text NOT NULL,
  `users_id` integer NOT NULL,
  `rating` numeric(4, 2) NOT NULL DEFAULT 0,
  `recommend` enum('0','1') NULL,
  `public` enum('0','1') NOT NULL DEFAULT false,
  `approved` enum('0','1') NOT NULL DEFAULT false,
  `created` datetime NOT NULL,
  INDEX `reviews_idx_sku` (`sku`),
  INDEX `reviews_idx_users_id` (`users_id`),
  PRIMARY KEY (`reviews_id`),
  CONSTRAINT `reviews_fk_sku` FOREIGN KEY (`sku`) REFERENCES `products` (`sku`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `reviews_fk_users_id` FOREIGN KEY (`users_id`) REFERENCES `users` (`users_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB"] at /usr/home/eserte/.cpan/build/Interchange6-Schema-0.060_92-u59YO3/blib/lib/Interchange6/Schema.pm line 84
racke commented 9 years ago

I strongly recommend to drop support for MySQL 4 and document that.

http://www.cpantesters.org/cpan/report/59f46d16-caeb-11e4-941f-8e3fe0bfc7aa

SysPete commented 9 years ago

diag is missing a space after VER: # SQL_DBMS_VER5.6.22DBD::mysql 4.029 mysql_clientversion 50622 So this is mysql server & client 5.6.22 which is way more recent than my 5.5.41. The 4.x is dbd::mysql which again is more recent that mine. Time to test a newer mysql...

racke commented 9 years ago

Ah OK.

racke commented 9 years ago

Actually it looks like a bug:

 `public` enum('0','1') NOT NULL DEFAULT false,

Maybe other MySQL versions are less strict, but DEFAULT should be 0.

SysPete commented 9 years ago

I've got to the point (finally) where I know that the on_connect_do args we're passing in connect_info is causing mysql v5.6.22 to barf on initial connect so DBIC doesn't manage to grab the database version string and then all hell breaks loose. Now just need to find out what exactly...

racke commented 9 years ago

Aha, OK.

ribasushi commented 9 years ago

@SysPete if time permits can you check whether https://cpan.metacpan.org/authors/id/R/RI/RIBASUSHI/DBIx-Class-0.082899_08.tar.gz does the right thing on your codebase when you revert d6464b2? Want to make sure I covered all bases

SysPete commented 9 years ago

@ribasushi here's what happens with DBIx::Class@0.082899_08 using MySQL server v5.6.22:

DBIx::Class::Storage::DBI::_do_query(): DBI Exception: DBD::mysql::db do failed: Variable 'sql_mode' can't be set to the value of 'TRADITIONALNO_ENGINE_SUBSTITUTION' [for Statement "SET SQL_MODE = CONCAT('ANSI,TRADITIONAL', @@sql_mode)"] at /home/apm/git/interchange6-schema/lib/Interchange6/Schema.pm line 84
    # Child (testing with main) exited without calling finalize()

With MySQL server v5.5.41 and DBIx::Class@0.082899_08 all tests pass as they did before. Using the same DBIC with either MySQL version post d6464b2 all tests pass.

ribasushi commented 9 years ago

On 04/07/2015 10:18 AM, Peter Mottram wrote:

@ribasushi https://github.com/ribasushi here's what happens with DBIx::Class@0.082899_08 using MySQL server v5.6.22:

|DBIx::Class::Storage::DBI::_do_query(): DBI Exception: DBD::mysql::db do failed: Variable 'sql_mode' can't be set to the value of 'TRADITIONALNO_ENGINE_SUBSTITUTION' [for Statement "SET SQL_MODE = CONCAT('ANSI,TRADITIONAL', @@sql_mode)"] at /home/apm/git/interchange6-schema/lib/Interchange6/Schema.pm line 84

Child (testing with main) exited without calling finalize()|

|Is this an exception though? I.e. does the process stop right there, or does it still continue afterwards?|

SysPete commented 9 years ago

On 07/04/15 13:12, Peter Rabbitson wrote:

On 04/07/2015 10:18 AM, Peter Mottram wrote:

@ribasushi https://github.com/ribasushi here's what happens with DBIx::Class@0.082899_08 using MySQL server v5.6.22:

|DBIx::Class::Storage::DBI::_do_query(): DBI Exception: DBD::mysql::db do failed: Variable 'sql_mode' can't be set to the value of 'TRADITIONALNO_ENGINE_SUBSTITUTION' [for Statement "SET SQL_MODE = CONCAT('ANSI,TRADITIONAL', @@sql_mode)"] at /home/apm/git/interchange6-schema/lib/Interchange6/Schema.pm line 84

Child (testing with main) exited without calling finalize()|

|Is this an exception though? I.e. does the process stop right there, or does it still continue afterwards?| Yes: it is an exception and causes calling code to die.

ribasushi commented 9 years ago

On 04/07/2015 01:18 PM, Peter Mottram wrote:

On 07/04/15 13:12, Peter Rabbitson wrote:

On 04/07/2015 10:18 AM, Peter Mottram wrote:

@ribasushi https://github.com/ribasushi here's what happens with DBIx::Class@0.082899_08 using MySQL server v5.6.22:

|DBIx::Class::Storage::DBI::_do_query(): DBI Exception: DBD::mysql::db do failed: Variable 'sql_mode' can't be set to the value of 'TRADITIONALNO_ENGINE_SUBSTITUTION' [for Statement "SET SQL_MODE = CONCAT('ANSI,TRADITIONAL', @@sql_mode)"] at /home/apm/git/interchange6-schema/lib/Interchange6/Schema.pm line 84

Child (testing with main) exited without calling finalize()|

|Is this an exception though? I.e. does the process stop right there, or does it still continue afterwards?| Yes: it is an exception and causes calling code to die.

Perfect. Just wanted to make sure I didn't miss anything ;)