? Failure

User tests: Successful: Unsuccessful:

avatar alexva24
alexva24
18 Feb 2018

Summary of Changes

Array of tables names passed to JDatabaseQueryElement constructor on delete method

Testing Instructions

$query=new JDatabaseQueryMysqli;
$query->delete('table');
echo $query;

Expected result

DELETE table
FROM table

Actual result

DELETE
FROM table

Documentation Changes Required

avatar alexva24 alexva24 - open - 18 Feb 2018
avatar alexva24 alexva24 - change - 18 Feb 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 Feb 2018
Category Libraries
avatar alexva24 alexva24 - change - 18 Feb 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 18 Feb 2018
Category Libraries Libraries Unit Tests
avatar brianteeman
brianteeman - comment - 22 Feb 2018

Is the description correct? the expected and actual results are identical

avatar alexva24
alexva24 - comment - 23 Feb 2018

Sure

avatar brianteeman
brianteeman - comment - 23 Feb 2018

So if nothing has changed between the actual and expected result what is the purpose of this PR?

avatar alexva24 alexva24 - change - 23 Feb 2018
The description was changed
avatar alexva24 alexva24 - edited - 23 Feb 2018
avatar alexva24
alexva24 - comment - 23 Feb 2018

The description fixed. With my changes you can able build a multy-tables delete sql query.

avatar mbabker
mbabker - comment - 23 Feb 2018

Based on the MySQL docs this doesn't look correct, see https://dev.mysql.com/doc/refman/5.7/en/delete.html

It also seems that other database drivers do not support this syntax. PostgreSQL doesn't (or if it does the doc page and examples do a terrible job communicating it).

avatar alexva24
alexva24 - comment - 23 Feb 2018

@mbabker see https://dev.mysql.com/doc/refman/5.7/en/delete.html#idm139816361856752
For MySQL it's correct.
For PostgreSQL seems doesn't.

avatar mbabker
mbabker - comment - 23 Feb 2018

For some reason I was expecting table_references to be a multi-table FROM, scrolling the page now I see it uses JOIN statements. I really shouldn't read PRs and SQL docs before ☕️.

If this is MySQL only syntax then it needs to be put in the MySQL subclasses, otherwise we need to come up with a way to emulate this for drivers that don't natively support it.

avatar alikon
alikon - comment - 23 Feb 2018

maybe too tired but what means ?

DELETE table
FROM table

please post an example use case

avatar mbabker
mbabker - comment - 23 Feb 2018

The example in the MySQL docs is better than what's here, see https://dev.mysql.com/doc/refman/5.7/en/delete.html#idm139816361732224

But basically you can construct a DELETE query to delete rows from multiple tables if you use the appropriate JOIN and WHERE conditions.

avatar alikon
alikon - comment - 23 Feb 2018

maybe i'm wrong but this doesn't seems to me an "SQL" standard DELETE statement

avatar alexva24 alexva24 - change - 23 Feb 2018
Labels Added: ?
avatar alexva24
alexva24 - comment - 23 Feb 2018

The changes moved to MySQLi subclass

avatar alexva24 alexva24 - change - 23 Feb 2018
The description was changed
avatar alexva24 alexva24 - edited - 23 Feb 2018
avatar joomla-cms-bot joomla-cms-bot - change - 24 Feb 2018
Category Libraries Unit Tests Libraries
avatar Quy
Quy - comment - 2 Jan 2020

@HLeithner Should this be closed as it appears to be a new feature for MySQL only and not a bug?

avatar HLeithner
HLeithner - comment - 2 Jan 2020

Thanks Quy, yes this would not go into j3 anyway and is something for the framework. But it seams to be a special case which shouldn't be done with the query builder.

avatar HLeithner HLeithner - change - 2 Jan 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-01-02 07:25:28
Closed_By HLeithner
avatar HLeithner HLeithner - close - 2 Jan 2020

Add a Comment

Login with GitHub to post a comment