-
Notifications
You must be signed in to change notification settings - Fork 54
Fulltext invalid chars #825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3148,11 +3148,13 @@ public function find(Document $collection, array $queries = [], ?int $limit = 25 | |
| "; | ||
|
|
||
| $sql = $this->trigger(Database::EVENT_DOCUMENT_FIND, $sql); | ||
|
|
||
| var_dump($sql); | ||
| try { | ||
| $stmt = $this->getPDO()->prepare($sql); | ||
|
|
||
| foreach ($binds as $key => $value) { | ||
| var_dump($key); | ||
| var_dump($value); | ||
|
Comment on lines
+3151
to
+3157
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove unconditional debug dumps from Line 3151 and Lines 3156-3157 dump raw SQL and bind values on every request. This can leak sensitive data and can break consumers expecting clean response output. Proposed fix- $sql = $this->trigger(Database::EVENT_DOCUMENT_FIND, $sql);
-var_dump($sql);
+ $sql = $this->trigger(Database::EVENT_DOCUMENT_FIND, $sql);
try {
$stmt = $this->getPDO()->prepare($sql);
foreach ($binds as $key => $value) {
- var_dump($key);
- var_dump($value);
if (gettype($value) === 'double') {
$stmt->bindValue($key, $this->getFloatPrecision($value), \PDO::PARAM_STR);
} else {🤖 Prompt for AI Agents |
||
| if (gettype($value) === 'double') { | ||
| $stmt->bindValue($key, $this->getFloatPrecision($value), \PDO::PARAM_STR); | ||
| } else { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,19 +23,19 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| abstract class Base extends TestCase | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use CollectionTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use CustomDocumentTypeTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // use CollectionTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // use CustomDocumentTypeTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use DocumentTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use AttributeTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use IndexTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use OperatorTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use PermissionTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use RelationshipTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use SpatialTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use SchemalessTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use ObjectAttributeTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use VectorTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use GeneralTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // use AttributeTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // use IndexTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // use OperatorTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // use PermissionTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // use RelationshipTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // use SpatialTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // use SchemalessTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // use ObjectAttributeTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // use VectorTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // use GeneralTests; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+26
to
+38
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Re-enable the disabled e2e trait suites in base test harness. Commenting out most trait Proposed fix-// use CollectionTests;
-// use CustomDocumentTypeTests;
+ use CollectionTests;
+ use CustomDocumentTypeTests;
use DocumentTests;
-// use AttributeTests;
-// use IndexTests;
-// use OperatorTests;
-// use PermissionTests;
-// use RelationshipTests;
-// use SpatialTests;
-// use SchemalessTests;
-// use ObjectAttributeTests;
-// use VectorTests;
-// use GeneralTests;
+ use AttributeTests;
+ use IndexTests;
+ use OperatorTests;
+ use PermissionTests;
+ use RelationshipTests;
+ use SpatialTests;
+ use SchemalessTests;
+ use ObjectAttributeTests;
+ use VectorTests;
+ use GeneralTests;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| protected static string $namespace; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2177,6 +2177,16 @@ public function testFindFulltextSpecialChars(): void | |
| ]); | ||
|
|
||
| $this->assertEquals(1, count($documents)); | ||
|
|
||
| $phrases = ["Álvaro"]; | ||
|
|
||
| foreach ($phrases as $phrase) { | ||
| $database->find($collection, [ | ||
| Query::search('ft', $phrase), | ||
| ]); | ||
| } | ||
|
|
||
| $this->assertEquals(999, 999999); | ||
|
Comment on lines
+2181
to
+2189
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block introduces a guaranteed test failure and no meaningful verification. Line 2189 always fails ( Suggested fix- $phrases = ["Álvaro"];
-
- foreach ($phrases as $phrase) {
- $database->find($collection, [
- Query::search('ft', $phrase),
- ]);
- }
-
- $this->assertEquals(999, 999999);
+ $phrases = ['Álvaro'];
+
+ foreach ($phrases as $phrase) {
+ $documents = $database->find($collection, [
+ Query::search('ft', $phrase),
+ ]);
+ $this->assertIsArray($documents);
+ }🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| public function testFindMultipleConditions(): void | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid enabling global fast-fail in committed PHPUnit config.
Setting
stopOnFailure="true"in shared config cuts off CI at the first failure, which hides additional failures and weakens debugging signal for contributors.Suggested change
📝 Committable suggestion
🤖 Prompt for AI Agents