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

Stack traces are not properly logged into MySQL #61

Closed
fmohr opened this issue Oct 26, 2022 · 3 comments · Fixed by #87
Closed

Stack traces are not properly logged into MySQL #61

fmohr opened this issue Oct 26, 2022 · 3 comments · Fixed by #87
Assignees
Labels
bug Something isn't working

Comments

@fmohr
Copy link
Collaborator

fmohr commented Oct 26, 2022

I presume that if a stack trace contains simple quotation marks ('), then it is not properly logged. Instead it logs the following error message:

1064 (42000): 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 '<something>'])
@fmohr fmohr added the bug Something isn't working label Oct 26, 2022
@LukasFehring
Copy link
Collaborator

I am starting to work on this issue :)

@LukasFehring
Copy link
Collaborator

LukasFehring commented Jan 17, 2023

The root of the problem has been found.

Due to the goal of supporting outdated SQL-versions we previously used the pure python implementation of the MySQL-connector library (when establishing a connection the keyword-argument use-pure = True was given). Unfortunately, this implementation does not support the standard escaping functionalities motivating our own escaping functionality.

To fix this problem we intend to

  • drop the use-pure parameter to use the c implemenation
  • use prepared statements to insert values into a preexisting database

This issue is closely related to #83. Therefore a goal of the 'hotfix' is to use components that can be easily moved to a new structure described in the issue.
In particular:

  • Introduce a insert_values function with the parameters
  • talbe_name
  • keys
  • values
  • conditions
    and handles the value insertion using prepared statements.
  • Every introduced functionality should be written with the goal of using bulk inserts

@LukasFehring
Copy link
Collaborator

I finished the implementation.

@tornede tornede linked a pull request Feb 8, 2023 that will close this issue
@tornede tornede closed this as completed Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants