gyselroth / tubee

Data management engine with synchronization support
GNU General Public License v3.0
4 stars 4 forks source link

pdo endpoint (mssql) generates wrong filter #39

Closed raffis closed 5 years ago

raffis commented 5 years ago

Describe the bug

[22-May-2019 08:25:09] WARNING: [pool www] child 231 said into stdout: "2019-22-05 08:25:09 [Tubee\Endpoint\Pdo,DEBUG]: find all resources from endpoint [kzn::roles::im-mssql-relations] with query [(AND type='Person-Department'AND person_id='4046677')]  "
[22-May-2019 08:25:09] WARNING: [pool www] child 231 said into stdout: "2019-22-05 08:25:09 [Tubee\Endpoint\Pdo\Wrapper,DEBUG]: execute sql query [SELECT * FROM view_TAMWEB_export_relations WHERE (AND type='Person-Department'AND person_id='4046677')]  "
[22-May-2019 08:25:09] WARNING: [pool www] child 231 said into stdout: "2019-22-05 08:25:09 [Tubee\Rest\Middlewares\ExceptionHandler,ERROR]: uncaught exception failed to execute sql query with error [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near the keyword 'AND'. (42000)]  [object] (Tubee\Endpoint\Pdo\Exception\InvalidQuery(code: 0): failed to execute sql query with error [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near the keyword 'AND'. (42000) at /usr/share/tubee/src/lib/Endpoint/Pdo/Wrapper.php:89)"
[22-May-2019 08:25:09] WARNING: [pool www] child 231 said into stdout: "[stacktrace]"

To Reproduce

Steps to reproduce the behavior:

Expected behavior

Should be (AND type='Person-Department'AND person_id='4046677') without leading AND.

Environment

Additional context

Add any other context about the problem here.