? Success
Pull Request for # 6204

User tests: Successful: Unsuccessful:

avatar lmcculley
lmcculley
27 Feb 2015

Lines 152-157 of /administrator/components/com_installer/models/database.php improperly uses the set clause with an insert query.

// Add new row.
$query->clear()
    ->insert($db->quoteName('#__schemas'))
    ->set($db->quoteName('extension_id') . '= 700')
    ->set($db->quoteName('version_id') . '= ' . $db->quote($schema));
$db->setQuery($query);

And should instead be similar to the following:

$query->clear()
    ->insert($db->quoteName('#__schemas'))
    ->columns($db->quoteName('extension_id') . ',' . $db->quoteName('version_id'))
    ->values('700, ' . $db->quote($schema));
$db->setQuery($query);

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
2.00

avatar lmcculley lmcculley - open - 27 Feb 2015
avatar joomla-cms-bot joomla-cms-bot - change - 27 Feb 2015
Labels Added: ?
avatar lmcculley
lmcculley - comment - 27 Feb 2015

@mbabker Thanks, I've made the edit.

avatar zero-24 zero-24 - change - 27 Feb 2015
Category SQL
avatar zero-24 zero-24 - change - 27 Feb 2015
The description was changed
Title
Fix for #6204, malformed SQL INSERT query
InstallerModelDatabase::fixSchemaVersion() malformed SQL INSERT query
Rel_Number 6204
Relation Type Pull Request for
Easy No Yes
avatar waader
waader - comment - 2 Mar 2015

@Imcculley How should this be tested?

avatar mbabker
mbabker - comment - 2 Mar 2015

Install extensions as usual and validate data is properly written to the #__schemas table in your database.

avatar mbabker
mbabker - comment - 2 Mar 2015

Oh, wait, excuse me. Just realized this is the fix function.

Umm... Not so easy to actually test as the only way I can think of doing so is clearing the row in the database, but may throw errors when you run the fix function because all the data already exists.

avatar lmcculley
lmcculley - comment - 2 Mar 2015

@waader Have 3.3.6 (or any 3.x version previous, I believe) and upgrade to 3.4 by manually updating the files. Then, login through the admin interface, go to Extensions -> Extension Manager -> Database and click the Fix button.

avatar waader
waader - comment - 2 Mar 2015

@test works! Thanks!

avatar waader waader - test_item - 2 Mar 2015 - Tested successfully
avatar lmcculley
lmcculley - comment - 11 Mar 2015

Any word as to when this PR might be merged?

avatar waader
waader - comment - 12 Mar 2015

A second test is needed. We will have a local PBF-Event this weekend and this patch is on my list.

avatar lmcculley
lmcculley - comment - 12 Mar 2015

Sounds great, thanks for the update!

avatar sovainfo
sovainfo - comment - 12 Mar 2015

Could only reproduce issue with PostgreSQL or MSSQL.
Tested by simply changing the schema in the database (set it to '3.3.6').

Patch resolves the issue!
@test OK

avatar zero-24 zero-24 - change - 12 Mar 2015
Status Pending Ready to Commit
avatar sovainfo sovainfo - test_item - 12 Mar 2015 - Tested successfully
avatar zero-24
zero-24 - comment - 12 Mar 2015

RTC based on testing. Thanks!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6219.
avatar brianteeman brianteeman - change - 12 Mar 2015
Labels Added: ?
avatar zero-24 zero-24 - close - 13 Mar 2015
avatar phproberto phproberto - change - 13 Mar 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-03-13 10:00:44
avatar phproberto phproberto - close - 13 Mar 2015
avatar phproberto phproberto - close - 13 Mar 2015
avatar phproberto
phproberto - comment - 13 Mar 2015

Merged. Thanks!

avatar zero-24 zero-24 - change - 14 Oct 2015
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment