Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

delete: true gives errors #70

Closed
peterjaap opened this issue Apr 28, 2021 · 3 comments
Closed

delete: true gives errors #70

peterjaap opened this issue Apr 28, 2021 · 3 comments

Comments

@peterjaap
Copy link
Contributor

@johnorourke I just ran into this;

PHP Notice:  Undefined index: columns in phar:///usr/bin/masquerade/src/Elgentos/Masquerade/DataProcessor/DefaultDataProcessorFactory.php on line 27
PHP Warning:  Invalid argument supplied for foreach() in phar:///usr/bin/masquerade/src/Elgentos/Masquerade/DataProcessor/DefaultDataProcessorFactory.php on line 27
PHP Notice:  Array to string conversion in phar:///usr/bin/masquerade/src/Elgentos/Masquerade/Console/SymfonyOutput.php on line 92
Deleting records from Array table
In Connection.php line 669:
                                                                               
  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i  
  n your SQL syntax; check the manual that corresponds to your MySQL server v  
  ersion for the right syntax to use near 'as `main`' at line 1 (SQL: delete   
  from `swissup_checkoutfields_values` as `main`)                              
                                                                               
In PDOConnection.php line 72:
                                                                               
  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i  
  n your SQL syntax; check the manual that corresponds to your MySQL server v  
  ersion for the right syntax to use near 'as `main`' at line 1                
                                                                               
In PDOConnection.php line 67:
                                                                               
  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i  
  n your SQL syntax; check the manual that corresponds to your MySQL server v  
  ersion for the right syntax to use near 'as `main`' at line 1    

This is the yaml file I'm using; https://github.com/elgentos/masquerade/wiki/Swissup-YAML-file

Any idea?

@Tjitse-E
Copy link
Contributor

Tjitse-E commented Apr 29, 2021

@peterjaap I also ran into this today. This is because of https://github.com/elgentos/masquerade/blob/master/src/Elgentos/Masquerade/DataProcessor/TableService.php#L53-L56

The delete query will result in:

delete from your_table as `main` where ...

It should be just:

delete from your_table where ...

I don't know if the alias 'main' is actually used in Masquerade, else we could remove it.

@johnorourke
Copy link
Contributor

@peterjaap looks like @Tjitse-E fixed this in #73

@peterjaap
Copy link
Contributor Author

Thanks all! New release has been tagged https://github.com/elgentos/masquerade/releases/tag/0.3.1

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

Successfully merging a pull request may close this issue.

3 participants