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

Double dash (--) causes issues during the search #13730

Open
PurpleMagick opened this issue Oct 22, 2024 · 0 comments
Open

Double dash (--) causes issues during the search #13730

PurpleMagick opened this issue Oct 22, 2024 · 0 comments

Comments

@PurpleMagick
Copy link

What problem has occurred? What issues has it caused?

From this PR which tried to blacklist 90303--62897. Opening the MS search for that term leads to an error

Mysql2::Error: syntax error, unexpected '-': SELECT COUNT(*) AS count_all, posts.is_tp AS posts_is_tp, posts.is_fp AS posts_is_fp, posts.is_naa AS posts_is_naa FROM posts WHERE (MATCH (posts.body) AGAINST ('%90303--62897%' IN BOOLEAN MODE)) GROUP BY posts.is_tp, posts.is_fp, posts.is_naa

image

The full trace is:

[mysql2 (0.5.3) lib/mysql2/client.rb:131:in `_query'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[mysql2 (0.5.3) lib/mysql2/client.rb:131:in `block in query'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[mysql2 (0.5.3) lib/mysql2/client.rb:130:in `handle_interrupt'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[mysql2 (0.5.3) lib/mysql2/client.rb:130:in `query'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[rack-mini-profiler (1.1.6) lib/patches/db/mysql2.rb:22:in `query'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/abstract_mysql_adapter.rb:187:in `block (2 levels) in execute'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activesupport (5.2.6.2) lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activesupport (5.2.6.2) lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activesupport (5.2.6.2) lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/abstract_mysql_adapter.rb:186:in `block in execute'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/abstract_adapter.rb:580:in `synchronize'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activesupport (5.2.6.2) lib/active_support/notifications/instrumenter.rb:23:in `instrument'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/abstract_mysql_adapter.rb:185:in `execute'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/mysql/database_statements.rb:28:in `execute'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/abstract_mysql_adapter.rb:196:in `execute_and_free'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/mysql/database_statements.rb:33:in `exec_query'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/abstract/database_statements.rb:478:in `select'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/abstract/database_statements.rb:70:in `select_all'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/abstract/query_cache.rb:104:in `block in select_all'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/abstract/query_cache.rb:127:in `block in cache_sql'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/abstract/query_cache.rb:113:in `synchronize'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/abstract/query_cache.rb:113:in `cache_sql'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/abstract/query_cache.rb:104:in `select_all'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/connection_adapters/mysql/database_statements.rb:12:in `select_all'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/relation/calculations.rb:337:in `block in execute_grouped_calculation'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/relation.rb:584:in `skip_query_cache_if_necessary'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/relation/calculations.rb:337:in `execute_grouped_calculation'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/relation/calculations.rb:236:in `perform_calculation'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/relation/calculations.rb:146:in `calculate'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[groupdate (5.0.0) lib/groupdate/relation.rb:13:in `calculate'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/relation/calculations.rb:52:in `count'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[app/controllers/search_controller.rb:123:in `block (2 levels) in index'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_controller/metal/mime_responds.rb:203:in `respond_to'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[app/controllers/search_controller.rb:121:in `index'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/abstract_controller/base.rb:194:in `process_action'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_controller/metal/rendering.rb:30:in `process_action'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/abstract_controller/callbacks.rb:42:in `block in process_action'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activesupport (5.2.6.2) lib/active_support/callbacks.rb:109:in `block in run_callbacks'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[audited (4.10.0) lib/audited/sweeper.rb:14:in `around'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activesupport (5.2.6.2) lib/active_support/callbacks.rb:118:in `block in run_callbacks'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[audited (4.10.0) lib/audited/sweeper.rb:14:in `around'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activesupport (5.2.6.2) lib/active_support/callbacks.rb:118:in `block in run_callbacks'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activesupport (5.2.6.2) lib/active_support/callbacks.rb:136:in `run_callbacks'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/abstract_controller/callbacks.rb:41:in `process_action'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_controller/metal/rescue.rb:22:in `process_action'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activesupport (5.2.6.2) lib/active_support/notifications.rb:168:in `block in instrument'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activesupport (5.2.6.2) lib/active_support/notifications/instrumenter.rb:23:in `instrument'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activesupport (5.2.6.2) lib/active_support/notifications.rb:168:in `instrument'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_controller/metal/instrumentation.rb:32:in `process_action'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_controller/metal/params_wrapper.rb:256:in `process_action'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activerecord (5.2.6.2) lib/active_record/railties/controller_runtime.rb:24:in `process_action'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/abstract_controller/base.rb:134:in `process'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionview (5.2.6.2) lib/action_view/rendering.rb:32:in `process'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[rack-mini-profiler (1.1.6) lib/mini_profiler/profiling_methods.rb:78:in `block in profile_method'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_controller/metal.rb:191:in `dispatch'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_controller/metal.rb:252:in `dispatch'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_dispatch/routing/route_set.rb:52:in `dispatch'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_dispatch/routing/route_set.rb:34:in `serve'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_dispatch/journey/router.rb:52:in `block in serve'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_dispatch/journey/router.rb:35:in `each'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_dispatch/journey/router.rb:35:in `serve'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_dispatch/routing/route_set.rb:840:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[warden (1.2.9) lib/warden/manager.rb:36:in `block in call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[warden (1.2.9) lib/warden/manager.rb:34:in `catch'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[warden (1.2.9) lib/warden/manager.rb:34:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[rack (2.2.8.1) lib/rack/tempfile_reaper.rb:15:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[rack (2.2.8.1) lib/rack/etag.rb:27:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[rack (2.2.8.1) lib/rack/conditional_get.rb:27:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[rack (2.2.8.1) lib/rack/head.rb:12:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_dispatch/http/content_security_policy.rb:18:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[rack (2.2.8.1) lib/rack/session/abstract/id.rb:266:in `context'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[rack (2.2.8.1) lib/rack/session/abstract/id.rb:260:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_dispatch/middleware/cookies.rb:670:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activesupport (5.2.6.2) lib/active_support/callbacks.rb:98:in `run_callbacks'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_dispatch/middleware/callbacks.rb:26:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[railties (5.2.6.2) lib/rails/rack/logger.rb:38:in `call_app'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[railties (5.2.6.2) lib/rails/rack/logger.rb:26:in `block in call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activesupport (5.2.6.2) lib/active_support/tagged_logging.rb:71:in `block in tagged'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activesupport (5.2.6.2) lib/active_support/tagged_logging.rb:28:in `tagged'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activesupport (5.2.6.2) lib/active_support/tagged_logging.rb:71:in `tagged'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[railties (5.2.6.2) lib/rails/rack/logger.rb:26:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_dispatch/middleware/request_id.rb:27:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[rack (2.2.8.1) lib/rack/method_override.rb:24:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[rack (2.2.8.1) lib/rack/runtime.rb:22:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[activesupport (5.2.6.2) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_dispatch/middleware/executor.rb:14:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[actionpack (5.2.6.2) lib/action_dispatch/middleware/static.rb:127:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[rack (2.2.8.1) lib/rack/sendfile.rb:110:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[rack-cors (0.4.1) lib/rack/cors.rb:81:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[rack-mini-profiler (1.1.6) lib/mini_profiler/profiler.rb:184:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[railties (5.2.6.2) lib/rails/engine.rb:524:in `call'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:107:in `process_request'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:149:in `accept_and_process_next_request'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:419:in `block (3 levels) in start_threads'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)
[/usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception'](https://metasmoke.erwaysoftware.com/search?utf8=%E2%9C%93&body=90303--62897#)

What would you like to happen/not happen?

To not have an error and searching for text that includes -- should bring up results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant