Project

General

Profile

Bug(バグ) #4162

OpenPNE 3 - Task(タスク) #4033: MySQLのStrict Modeを有効にした場合に生じる問題を調査

MySQLのSTRICT_TRANS_TABLESが有効な状態でテスト用fixtureのロードに失敗する

Added by Youichi Kimura almost 7 years ago. Updated over 6 years ago.

Status:
Fixed(完了)
Priority:
Normal(通常)
Target version:
Start date:
2017-04-04
Due date:
% Done:

100%

3.6 で発生するか:
Unknown (未調査)
[QA]バグ通知済:
No
3.8 で発生するか:
Unknown (未調査)

Description

Overview (概要)

MySQL 5.7 の Strict Mode が有効な状態での動作確認 (#4033) を行った際に発生した。

fixture の読み込みを必要とするテストコードを実行すると下記のエラーが発生する:

$ php plugins/opMessagePlugin/test/unit/model/SendMessageDataTest.php 
PHP Fatal error:  Uncaught exception 'Doctrine_Connection_Mysql_Exception' with message 'SQLSTATE[HY000]: General error: 1364 Field 'message_id' doesn't have a default value' in /vagrant/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php:1082
Stack trace:
#0 /vagrant/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/Statement.php(269): Doctrine_Connection->rethrowException(Object(PDOException), Object(Doctrine_Connection_Statement))
#1 /vagrant/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php(1042): Doctrine_Connection_Statement->execute(Array)
#2 /vagrant/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php(687): Doctrine_Connection->exec('INSERT INTO del...', Array)
#3 /vagrant/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php(647): Doctrine_Connection->insert(Object(DeletedMessageTable), Array)
#4 /vagrant/lib/ven in /vagrant/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php on line 1082

Causes (原因)

source:test/fixtures/010_message.yml@6eef6b49#L106:

DeletedMessage:
  dust_delete_mesage:
    id: 1
    Member: first_member
    message_send_list_id: 3
    is_deleted: 0

上記の fixture で、NOT NULL 制約のある deleted_message.message_id に値がセットされていないことが原因。


Subtasks

Backport(バックポート) #4184: MySQLのSTRICT_TRANS_TABLESが有効な状態でテスト用fixtureのロードに失敗するNew(新規)Shinichi Urabe

Backport(バックポート) #4185: MySQLのSTRICT_TRANS_TABLESが有効な状態でテスト用fixtureのロードに失敗するNew(新規)Shinichi Urabe


Related issues

Copied to opMessagePlugin - Backport(バックポート) #4184: MySQLのSTRICT_TRANS_TABLESが有効な状態でテスト用fixtureのロードに失敗する New(新規) 2017-04-04

Associated revisions

Revision ad1c9168 (diff)
Added by Shinichi Urabe over 6 years ago

(refs #4162) fixes allow null in deleted_message.message_id, deleted_message.send_message_list_id

Revision 71325847
Added by ShinichiU over 6 years ago

Merge pull request #17 from ShinichiU/t-4162

(refs #4162) fixes allow null in deleted_message.message_id, deleted_…

History

#1 Updated by Shinichi Urabe over 6 years ago

  • Status changed from New(新規) to Accepted(着手)
  • Assignee set to Shinichi Urabe
  • Target version set to 2.0.0.3 alpha 3

#2 Updated by Shinichi Urabe over 6 years ago

  • Status changed from Accepted(着手) to Pending Review(レビュー待ち)
  • % Done changed from 0 to 50

#3 Updated by Shinichi Urabe over 6 years ago

#4 Updated by Shinichi Urabe over 6 years ago

  • Description updated (diff)

#5 Updated by Shinichi Urabe over 6 years ago

  • Description updated (diff)

#6 Updated by Shinichi Urabe over 6 years ago

  • Status changed from Pending Review(レビュー待ち) to Fixed(完了)
  • % Done changed from 50 to 100

merged

Also available in: Atom PDF