Skip to content

Commit

Permalink
Merge pull request INTER-Mediator#1837 from msyk/master
Browse files Browse the repository at this point in the history
Bug fix for numeric field searching.
  • Loading branch information
matsuo committed Sep 9, 2023
2 parents 87ac2e1 + f22657d commit 52c4bd1
Show file tree
Hide file tree
Showing 17 changed files with 1,582 additions and 1,681 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The demo with the latest version of INTER-Mediator is here:
- https://demo.inter-mediator.com/INTER-Mediator/samples/

This demo page works on INTER-Mediator Ver.5.x (Milestone version).
INTER-Mediator Ver.6 was quite different from previous versions. So we have called the Stable version for the final release of Ver.5.
INTER-Mediator Ver.6 was quite different from previous versions. So we have called the Milestone version for the final release of Ver.5.
- https://demo.inter-mediator.com/INTER-Mediator_milestone/Samples/

## Documentation
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
}
},
"require-dev": {
"phpunit/phpunit": "*",
"phpstan/phpstan": "^1.10"
"phpunit/phpunit": "*"
},
"autoload": {
"psr-4": {
Expand Down
585 changes: 267 additions & 318 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist-docs/change_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Ver.12 (In Development)
- (Ver.9) The setUpdatedRecord method in database classes renamed to setDataToUpdatedRecord. For the compatibility,
calling the setUpdateRecord method more than one parameter redirect to setDataToUpdatedRecord method.
The setUpdatedRecord with one parameter works as the setter of updatedRecord property.
- [BUG FIX] The data-im="_@condition:..." way with numeric field and the "match" operator didn't expand the condition
clause with '%term%' value. As far as PostgreSQL goes, the casting to text is automatically applied it.

Ver.11 (July 27, 2023)
- Generic exporting class prepared as DB\Export.php.
Expand Down
540 changes: 270 additions & 270 deletions package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,18 @@ public function testAddingLCCondtions11()
'((("num0" = \'100\' OR "num0" < \'300\') AND ("num1" = 100 OR "num1" < 300))'
. ' AND ((("f1" = \'valueA\' OR "f2" = \'valueA\') OR ("f1" = \'extra\' OR "f2" = \'extra\')) OR ("f1" < \'valueB\' OR "f2" < \'valueB\') OR ("f3" = \'valueC\')))');
}
public function testAddingLCCondtions12()
{
$this->checkConditions(null,
[
['field' => 'num0', 'operator' => '=', 'value' => 100],
['field' => 'num0', 'operator' => '<', 'value' => 300],
['field' => '__operation__', 'operator' => 'ex',],
['field' => 'num1', 'operator' => '=', 'value' => 100],
['field' => 'num1', 'operator' => '<', 'value' => 300],
['field' => '__operation__', 'operator' => 'block/false/false/false'],
['field' => 'num1', 'operator' => '*match*', 'value' => '999'],
],
$this->lcConditionLike);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,6 @@ function dbProxySetupForCondition(?array $queryArray): void
protected string $sqlSETClause3 = "(`num1`,`num2`,`date1`,`date2`,`time1`,`time2`,`dt1`,`dt2`,`vc1`,`vc2`,`text1`,`text2`) "
. "VALUES(0,0,'','','','','','','','','','')";

protected string $lcConditionLike = '((("num0" = \'100\' OR "num0" < \'300\') AND ("num1" = 100 OR "num1" < 300))'
. ' AND (("num1" LIKE \'%999%\')))';
}
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,7 @@ function dbProxySetupForCondition(?array $queryArray):void
protected string $sqlSETClause3 = "(\"num1\",\"num2\",\"date1\",\"date2\",\"time1\",\"time2\",\"dt1\",\"dt2\",\"vc1\",\"vc2\",\"text1\",\"text2\") "
. "VALUES(0,0,'','','','','','','','','','')";

protected string $lcConditionLike = '((("num0" = \'100\' OR "num0" < \'300\') AND ("num1" = 100 OR "num1" < 300))'
. ' AND ((CAST("num1" AS TEXT) LIKE \'%999%\')))';

}
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,4 @@ function dbProxySetupForAuthAccess(string $contextName, int $maxRecord, $subCont
$resultInit = $this->db_proxy->initialize($this->dataSource, $this->options, $this->dbSpec, 2, $contextName);
$this->assertNotFalse($resultInit, 'Proxy::initialize must return true.');
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,7 @@ public function testCreateRecord2()
protected string $sqlSETClause3 = "(\"num1\",\"num2\",\"date1\",\"date2\",\"time1\",\"time2\",\"dt1\",\"dt2\",\"vc1\",\"vc2\",\"text1\",\"text2\") "
. "VALUES(0,0,'','','','','','','','','','')";

protected string $lcConditionLike = '((("num0" = \'100\' OR "num0" < \'300\') AND ("num1" = 100 OR "num1" < 300))'
. ' AND (("num1" LIKE \'%999%\')))';

}
Loading

0 comments on commit 52c4bd1

Please sign in to comment.