Jump to content


Photo

MySQL Strict Model check is broken

MySQL

  • Please log in to reply
2 replies to this topic

#1 vanbas

vanbas

    Member

  • New Members
  • PipPip
  • 16 posts

Posted 04 April 2013 - 10:33 AM

Below code in DatabaseCheckSafeModeServiceHelper.php is broken, as it fails the check when DB is NOT in strict mode.

00043             if (!DatabaseCompatibilityUtil::isDatabaseStrictMode('mysql',
00044                                                                  $this->form->databaseHostname,
00045                                                                  $this->form->databaseUsername,
00046                                                                  $this->form->databasePassword,
00047                                                                  $this->form->databasePort))
00048             {
00049                 $this->message  = Yii::t('Default', 'Database is in strict mode.');
00050                 $passed = false;
00051             }
00052             else
00053             {
00054                 $this->message = Yii::t('Default', 'Database is not in strict mode.');
00055             }
00056             return $passed;

 

The test case does not catch the defect as below code DatabaseCompatibilityUtil.php:

 

00718                     if (isset($row[0]))
00719                     {
00720                         if ($row[0] == '' || strstr($row[0], 'STRICT_TRANS_TABLES') !== false)
00721                         {
00722                             $isStrict = true;
00723                         }
00724                         else
00725                         {
00726                             $isStrict = false;
00727                         }
00728                         return $isStrict;
00729                     }

As long as the @@sql_mode is emtpy, the strict mode is not enabled but the case here is wrong.



#2 Ivica

Ivica

    Advanced Member

  • Moderators
  • 565 posts

Posted 05 April 2013 - 06:58 AM

Right this seems wrong, I added PT story for this, we will fix this issue in Zurmo 1.5 release.



#3 Ivica

Ivica

    Advanced Member

  • Moderators
  • 565 posts

Posted 12 April 2013 - 02:21 PM

This issue is fixed,and will be part on next stable release.







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users