FaaPz / PDO

Just another PDO database library
MIT License
316 stars 103 forks source link

Fixing issues with v2-dev including union and sub-queries. #101

Closed kwhat closed 5 years ago

kwhat commented 6 years ago

Fixes issues with SELECT * and table.column.

Caffe1neAdd1ct commented 6 years ago

What would happen with columns which clash with SQL key words and functions in this case?

kwhat commented 6 years ago

@Caffe1neAdd1ct user can manually escape in the query. The current escape is not quite correct as it should do 'table'.'column' instead of 'table.column'. I may go back and fix that if I can find a clean way to get it done.

Caffe1neAdd1ct commented 6 years ago

Good point, that would be fine.

However inside backticks I think full stop characters are allowed, at least in MySQL...

If not quoted with backticks already by the user, splitting on the full stop then quote on the 2 identifiers, if already quoted.. leave alone?

On Fri, 4 May 2018, 19:07 Alex Barker, notifications@github.com wrote:

@Caffe1neAdd1ct https://github.com/Caffe1neAdd1ct user can manually escape in the query. The current escape is not quite correct as it should do 'table'.'column' instead of 'table.column'. I may go back and fix that if I can find a clean way to get it done.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/FaaPz/Slim-PDO/pull/101#issuecomment-386687586, or mute the thread https://github.com/notifications/unsubscribe-auth/ABRA5MUzl6mgIir6EphwH4XnD1dTqKuwks5tvJjkgaJpZM4TzCdC .

kwhat commented 6 years ago

@Caffe1neAdd1ct yah I'm working though it right now. Should have an update shortly.

kwhat commented 5 years ago

I have removed the back-ticks as the current approach is very broken. I have also added union support to select and sub-query support in various places.