Project

General

Profile

Actions

Task(タスク) #4159

open

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

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

Added by Youichi Kimura almost 8 years ago. Updated almost 5 years ago.

Status:
New(新規)
Priority:
Normal(通常)
Assignee:
-
Target version:
Start date:
2017-02-17
Due date:
% Done:

0%

Estimated time:

Description

Overview (概要)

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

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

$ php test/unit/model/doctrine/MemberTest.php 
PHP Fatal error:  Uncaught exception 'Doctrine_Connection_Mysql_Exception' with message 'SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '' for column 'value_datetime' at row 1' 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 mem...', Array)
#3 /vagrant/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php(647): Doctrine_Connection->insert(Object(MemberProfileTable), in /vagrant/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php on line 1082

Causes (原因)

source:test/fixtures/common/test_data.yml@43190aa1#L344:

  second_member_profile_birthday:
    value: "" 
    value_datetime: "" 
    public_flag: 1
    Member: second_member
    Profile: profile_birthday
    children: []

上記の value_datetime に空文字列をセットしていることが原因。

source:test/fixtures/common/xss_test_data.yml@43190aa1#L244:

OAuthMemberToken:
  first_member_html_oauth_token:
    key_string: "fIrStMeMbErHtMlOaUtHtOkEn" 
    secret: "fIrStMeMbErHtMlOaUtHsEcReT" 
    type: "access" 
    is_active: 1
    Consumer: html_oauth_consumer1
    Member: first_member

また、上記の key_string についても定義されている VARCHAR のサイズを越える文字列のためエラーが発生する。

Actions #1

Updated by kaoru n over 7 years ago

  • Target version changed from OpenPNE 3.9.0-old to OpenPNE 3.9.0
Actions #2

Updated by kaoru n almost 5 years ago

  • Target version changed from OpenPNE 3.9.0 to OpenPNE 3.10.x
Actions

Also available in: Atom PDF