Skip to content
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

fix(View): column might be saved as null #1196

Merged
merged 1 commit into from
Jul 22, 2024
Merged

Conversation

blizzz
Copy link
Member

@blizzz blizzz commented Jul 12, 2024

fixes #1188

TODO: in a follow up PR(s): prevent save in frontend, and repair step to clean the database from such entries.

@blizzz blizzz force-pushed the fix/1188/null-column-filter branch from 5101555 to 42697c6 Compare July 12, 2024 15:26
@blizzz blizzz changed the title Fix/1188/null column filter fix(View): column might be saved as null Jul 12, 2024
@blizzz blizzz requested a review from enjeck July 12, 2024 15:27
@blizzz blizzz added bug Something isn't working 3. to review Waiting for reviews labels Jul 12, 2024
@blizzz
Copy link
Member Author

blizzz commented Jul 12, 2024

/backport to stable0.7

@backportbot backportbot bot added the backport-request Pending backport by the backport-bot label Jul 12, 2024
@blizzz blizzz mentioned this pull request Jul 12, 2024
Copy link
Contributor

@enjeck enjeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, it does not break everything anymore. But the view still is created. And it doesn't load

Screenshot from 2024-07-12 16-31-46

Error trace nextcloud-1 | {"reqId":"vA5U9ylt88n4P6pYlP66","level":3,"time":"2024-07-12T15:35:37+00:00","remoteAddr":"192.168.21.5","user":"admin","app":"tables","method":"GET","url":"/index.php/apps/tables/row/view/5","message":"An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '))' at line 1","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36","version":"30.0.0.1","exception":{"Exception":"OC\\DB\\Exceptions\\DbalException","Message":"An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '))' at line 1","Code":1064,"Trace":[{"file":"/var/www/html/lib/private/DB/ConnectionAdapter.php","line":55,"function":"wrap","class":"OC\\DB\\Exceptions\\DbalException","type":"::","args":[["Doctrine\\DBAL\\Exception\\SyntaxErrorException"]]},{"file":"/var/www/html/apps/tables/lib/Db/Row2Mapper.php","line":153,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->","args":["SELECT `id` FROM `*PREFIX*tables_row_sleeves` `sleeves` WHERE (`table_id` = :dcValue1) AND (())",[1],[1]]},{"file":"/var/www/html/apps/tables/lib/Db/Row2Mapper.php","line":177,"function":"getWantedRowIds","class":"OCA\\Tables\\Db\\Row2Mapper","type":"->","args":["admin",1,[[[null,null,""]]],null,null]},{"file":"/var/www/html/apps/tables/lib/Service/RowService.php","line":109,"function":"findAll","class":"OCA\\Tables\\Db\\Row2Mapper","type":"->","args":[[["OCA\\Tables\\Db\\Column",1],["OCA\\Tables\\Db\\Column",2],["OCA\\Tables\\Db\\Column",3],["OCA\\Tables\\Db\\Column",4]],[["OCA\\Tables\\Db\\Column",1],["OCA\\Tables\\Db\\Column",2],["OCA\\Tables\\Db\\Column",3],["OCA\\Tables\\Db\\Column",4]],1,null,null,[[[null,null,""]]],[],"admin"]},{"file":"/var/www/html/apps/tables/lib/Controller/RowController.php","line":48,"function":"findAllByView","class":"OCA\\Tables\\Service\\RowService","type":"->","args":[5,"admin"]},{"file":"/var/www/html/apps/tables/lib/Controller/Errors.php","line":16,"function":"OCA\\Tables\\Controller\\{closure}","class":"OCA\\Tables\\Controller\\RowController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/tables/lib/Controller/RowController.php","line":49,"function":"handleError","class":"OCA\\Tables\\Controller\\RowController","type":"->","args":[["Closure"]]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"indexView","class":"OCA\\Tables\\Controller\\RowController","type":"->","args":[5]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Tables\\Controller\\RowController"],"indexView"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Tables\\Controller\\RowController"],"indexView"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Tables\\Controller\\RowController","indexView",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["5","tables.row.indexview"]]},{"file":"/var/www/html/lib/base.php","line":988,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/tables/row/view/5"]},{"file":"/var/www/html/index.php","line":24,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/DB/Exceptions/DbalException.php","Line":54,"Previous":{"Exception":"Doctrine\\DBAL\\Exception\\SyntaxErrorException","Message":"An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '))' at line 1","Code":1064,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1943,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->","args":[["Doctrine\\DBAL\\Driver\\PDO\\Exception"],["Doctrine\\DBAL\\Query"]]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1885,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->","args":[["Doctrine\\DBAL\\Driver\\PDO\\Exception"],["Doctrine\\DBAL\\Query"]]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1106,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":[["Doctrine\\DBAL\\Driver\\PDO\\Exception"],"SELECT `id` FROM `oc_tables_row_sleeves` `sleeves` WHERE (`table_id` = ?) AND (())",[1],[1]]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":304,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":["SELECT `id` FROM `oc_tables_row_sleeves` `sleeves` WHERE (`table_id` = ?) AND (())",[1],[1],null]},{"file":"/var/www/html/lib/private/DB/ConnectionAdapter.php","line":52,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->","args":["SELECT `id` FROM `oc_tables_row_sleeves` `sleeves` WHERE (`table_id` = :dcValue1) AND (())",[1],[1]]},{"file":"/var/www/html/apps/tables/lib/Db/Row2Mapper.php","line":153,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->","args":["SELECT `id` FROM `*PREFIX*tables_row_sleeves` `sleeves` WHERE (`table_id` = :dcValue1) AND (())",[1],[1]]},{"file":"/var/www/html/apps/tables/lib/Db/Row2Mapper.php","line":177,"function":"getWantedRowIds","class":"OCA\\Tables\\Db\\Row2Mapper","type":"->","args":["admin",1,[[[null,null,""]]],null,null]},{"file":"/var/www/html/apps/tables/lib/Service/RowService.php","line":109,"function":"findAll","class":"OCA\\Tables\\Db\\Row2Mapper","type":"->","args":[[["OCA\\Tables\\Db\\Column",1],["OCA\\Tables\\Db\\Column",2],["OCA\\Tables\\Db\\Column",3],["OCA\\Tables\\Db\\Column",4]],[["OCA\\Tables\\Db\\Column",1],["OCA\\Tables\\Db\\Column",2],["OCA\\Tables\\Db\\Column",3],["OCA\\Tables\\Db\\Column",4]],1,null,null,[[[null,null,""]]],[],"admin"]},{"file":"/var/www/html/apps/tables/lib/Controller/RowController.php","line":48,"function":"findAllByView","class":"OCA\\Tables\\Service\\RowService","type":"->","args":[5,"admin"]},{"file":"/var/www/html/apps/tables/lib/Controller/Errors.php","line":16,"function":"OCA\\Tables\\Controller\\{closure}","class":"OCA\\Tables\\Controller\\RowController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/tables/lib/Controller/RowController.php","line":49,"function":"handleError","class":"OCA\\Tables\\Controller\\RowController","type":"->","args":[["Closure"]]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"indexView","class":"OCA\\Tables\\Controller\\RowController","type":"->","args":[5]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Tables\\Controller\\RowController"],"indexView"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Tables\\Controller\\RowController"],"indexView"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Tables\\Controller\\RowController","indexView",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["5","tables.row.indexview"]]},{"file":"/var/www/html/lib/base.php","line":988,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/tables/row/view/5"]},{"file":"/var/www/html/index.php","line":24,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php","Line":86,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '))' at line 1","Code":1064,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":132,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::","args":[["PDOException",["42000",1064,"You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '))' at line 1"]]]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1099,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->","args":[]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":304,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":["SELECT `id` FROM `oc_tables_row_sleeves` `sleeves` WHERE (`table_id` = ?) AND (())",[1],[1],null]},{"file":"/var/www/html/lib/private/DB/ConnectionAdapter.php","line":52,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->","args":["SELECT `id` FROM `oc_tables_row_sleeves` `sleeves` WHERE (`table_id` = :dcValue1) AND (())",[1],[1]]},{"file":"/var/www/html/apps/tables/lib/Db/Row2Mapper.php","line":153,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->","args":["SELECT `id` FROM `*PREFIX*tables_row_sleeves` `sleeves` WHERE (`table_id` = :dcValue1) AND (())",[1],[1]]},{"file":"/var/www/html/apps/tables/lib/Db/Row2Mapper.php","line":177,"function":"getWantedRowIds","class":"OCA\\Tables\\Db\\Row2Mapper","type":"->","args":["admin",1,[[[null,null,""]]],null,null]},{"file":"/var/www/html/apps/tables/lib/Service/RowService.php","line":109,"function":"findAll","class":"OCA\\Tables\\Db\\Row2Mapper","type":"->","args":[[["OCA\\Tables\\Db\\Column",1],["OCA\\Tables\\Db\\Column",2],["OCA\\Tables\\Db\\Column",3],["OCA\\Tables\\Db\\Column",4]],[["OCA\\Tables\\Db\\Column",1],["OCA\\Tables\\Db\\Column",2],["OCA\\Tables\\Db\\Column",3],["OCA\\Tables\\Db\\Column",4]],1,null,null,[[[null,null,""]]],[],"admin"]},{"file":"/var/www/html/apps/tables/lib/Controller/RowController.php","line":48,"function":"findAllByView","class":"OCA\\Tables\\Service\\RowService","type":"->","args":[5,"admin"]},{"file":"/var/www/html/apps/tables/lib/Controller/Errors.php","line":16,"function":"OCA\\Tables\\Controller\\{closure}","class":"OCA\\Tables\\Controller\\RowController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/tables/lib/Controller/RowController.php","line":49,"function":"handleError","class":"OCA\\Tables\\Controller\\RowController","type":"->","args":[["Closure"]]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"indexView","class":"OCA\\Tables\\Controller\\RowController","type":"->","args":[5]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Tables\\Controller\\RowController"],"indexView"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Tables\\Controller\\RowController"],"indexView"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Tables\\Controller\\RowController","indexView",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["5","tables.row.indexview"]]},{"file":"/var/www/html/lib/base.php","line":988,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/tables/row/view/5"]},{"file":"/var/www/html/index.php","line":24,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":28,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '))' at line 1","Code":"42000","Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":130,"function":"execute","class":"PDOStatement","type":"->","args":[null]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1099,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->","args":[]},{"file":"/var/www/html/lib/private/DB/Connection.php","line":304,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":["SELECT `id` FROM `oc_tables_row_sleeves` `sleeves` WHERE (`table_id` = ?) AND (())",[1],[1],null]},{"file":"/var/www/html/lib/private/DB/ConnectionAdapter.php","line":52,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->","args":["SELECT `id` FROM `oc_tables_row_sleeves` `sleeves` WHERE (`table_id` = :dcValue1) AND (())",[1],[1]]},{"file":"/var/www/html/apps/tables/lib/Db/Row2Mapper.php","line":153,"function":"executeQuery","class":"OC\\DB\\ConnectionAdapter","type":"->","args":["SELECT `id` FROM `*PREFIX*tables_row_sleeves` `sleeves` WHERE (`table_id` = :dcValue1) AND (())",[1],[1]]},{"file":"/var/www/html/apps/tables/lib/Db/Row2Mapper.php","line":177,"function":"getWantedRowIds","class":"OCA\\Tables\\Db\\Row2Mapper","type":"->","args":["admin",1,[[[null,null,""]]],null,null]},{"file":"/var/www/html/apps/tables/lib/Service/RowService.php","line":109,"function":"findAll","class":"OCA\\Tables\\Db\\Row2Mapper","type":"->","args":[[["OCA\\Tables\\Db\\Column",1],["OCA\\Tables\\Db\\Column",2],["OCA\\Tables\\Db\\Column",3],["OCA\\Tables\\Db\\Column",4]],[["OCA\\Tables\\Db\\Column",1],["OCA\\Tables\\Db\\Column",2],["OCA\\Tables\\Db\\Column",3],["OCA\\Tables\\Db\\Column",4]],1,null,null,[[[null,null,""]]],[],"admin"]},{"file":"/var/www/html/apps/tables/lib/Controller/RowController.php","line":48,"function":"findAllByView","class":"OCA\\Tables\\Service\\RowService","type":"->","args":[5,"admin"]},{"file":"/var/www/html/apps/tables/lib/Controller/Errors.php","line":16,"function":"OCA\\Tables\\Controller\\{closure}","class":"OCA\\Tables\\Controller\\RowController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/tables/lib/Controller/RowController.php","line":49,"function":"handleError","class":"OCA\\Tables\\Controller\\RowController","type":"->","args":[["Closure"]]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"indexView","class":"OCA\\Tables\\Controller\\RowController","type":"->","args":[5]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Tables\\Controller\\RowController"],"indexView"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Tables\\Controller\\RowController"],"indexView"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Tables\\Controller\\RowController","indexView",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["5","tables.row.indexview"]]},{"file":"/var/www/html/lib/base.php","line":988,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/tables/row/view/5"]},{"file":"/var/www/html/index.php","line":24,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":130}}},"message":"An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '))' at line 1","exception":{},"CustomMessage":"An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '))' at line 1"}} nextcloud-1 | {"reqId":"vA5U9ylt88n4P6pYlP66","level":2,"time":"2024-07-12T15:35:37+00:00","remoteAddr":"192.168.21.5","user":"admin","app":"tables","method":"GET","url":"/index.php/apps/tables/row/view/5","message":"An internal error or exception occurred: OCA\\Tables\\Db\\Row2Mapper - getWantedRowIds: An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '))' at line 1","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36","version":"30.0.0.1","data":{"app":"tables"}}

@blizzz
Copy link
Member Author

blizzz commented Jul 12, 2024

@enjeck i see, it is the only filter there

@enjeck
Copy link
Contributor

enjeck commented Jul 12, 2024

Maybe we shouldn't create the view at all in such cases

@blizzz
Copy link
Member Author

blizzz commented Jul 12, 2024

Maybe we shouldn't create the view at all in such cases

Generally yes, but also too late, they are already there. So need this anyway. I improve.

@blizzz
Copy link
Member Author

blizzz commented Jul 12, 2024

@enjeck please check with latest (fixup) commit. It seems it has the nice benefit that the bad filters will also not be stored anymore. A bit more expensive though, but this is temporarily until we have cleaned up stuff in the DB.

@enjeck
Copy link
Contributor

enjeck commented Jul 12, 2024

@enjeck please check with latest (fixup) commit. It seems it has the nice benefit that the bad filters will also not be stored anymore. A bit more expensive though, but this is temporarily until we have cleaned up stuff in the DB.

Works for me! Thanks!

@blizzz blizzz force-pushed the fix/1188/null-column-filter branch from 36beef5 to 8c9b58b Compare July 12, 2024 16:06
@blizzz
Copy link
Member Author

blizzz commented Jul 12, 2024

@enjeck please check with latest (fixup) commit. It seems it has the nice benefit that the bad filters will also not be stored anymore. A bit more expensive though, but this is temporarily until we have cleaned up stuff in the DB.

Works for me! Thanks!

Thanks! Squashed.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzz blizzz force-pushed the fix/1188/null-column-filter branch from 8c9b58b to 841e7a3 Compare July 22, 2024 16:58
@blizzz blizzz added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jul 22, 2024
@blizzz blizzz merged commit 88a1285 into main Jul 22, 2024
59 checks passed
@blizzz blizzz deleted the fix/1188/null-column-filter branch July 22, 2024 21:03
@backportbot backportbot bot removed the backport-request Pending backport by the backport-bot label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't erase table
3 participants