-
-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CRM-21687 fix issue with MariaDB 10.2 logging query writing due to cu…
…rrent_timestamp and timestamp getting () added on the end in Maria10.2
- Loading branch information
1 parent
62d684a
commit 91bd5c1
Showing
2 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
/** | ||
* Class CRM_Logging_SchmeaTest | ||
* @group headless | ||
*/ | ||
class CRM_Logging_SchemaTest extends CiviUnitTestCase { | ||
|
||
public function setUp() { | ||
parent::setUp(); | ||
} | ||
|
||
public function tearDown() { | ||
parent::tearDown(); | ||
} | ||
|
||
public function queryExamples() { | ||
$examples = []; | ||
$examples[] = ["`modified_date` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'When the mailing (or closely related entity) was created or modified or deleted.'", "`modified_date` timestamp NULL COMMENT 'When the mailing (or closely related entity) was created or modified or deleted.'"]; | ||
$examples[] = ["`modified_date` timestamp NULL DEFAULT current_timestamp ON UPDATE current_timestamp COMMENT 'When the mailing (or closely related entity) was created or modified or deleted.'", "`modified_date` timestamp NULL COMMENT 'When the mailing (or closely related entity) was created or modified or deleted.'"]; | ||
return $examples; | ||
} | ||
|
||
/** | ||
* Tests the function fixTimeStampAndNotNullSQL in CRM_Logging_Schema | ||
* | ||
* @dataProvider queryExamples | ||
*/ | ||
public function testQueryRewrite($query, $expectedQuery) { | ||
$this->assertEquals($expectedQuery, CRM_Logging_Schema::fixTimeStampAndNotNullSQL($query)); | ||
} | ||
|
||
} |