? ? Success

User tests: Successful: Unsuccessful:

avatar csthomas
csthomas
19 Dec 2016

Pull Request for Issue:

  • Update (with join) query (JDatabaseQueryPostgresql) on each call method __toString() generates different string.

Summary of Changes

  • Fix PostgreSQL update query to return the same string each time of call method __toString()
  • this PR become from #12839

Testing Instructions

Test by travis.
Code review.

Documentation Changes Required

N/A

avatar csthomas csthomas - open - 19 Dec 2016
avatar csthomas csthomas - change - 19 Dec 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 19 Dec 2016
Category Postgresql Libraries Unit Tests
avatar ggppdk
ggppdk - comment - 19 Dec 2016

Update query (JDatabaseQueryPostgresql) on each call method __toString() generates different string.

Can you give an example of a query that returns a different string on every call ?
which part of the query is different ?

avatar csthomas
csthomas - comment - 19 Dec 2016

On joomla that uses postgreSQL:

php > $db = JFactory::getDbo();
php > $q = $db->getQuery(true)->update('#__content a')->set('hits = 1')->innerJoin('#__categories c ON a.catid = c.id')->where('c.id = 5');
php > echo $q;

UPDATE #__content a
SET hits = 1
FROM #__categories c
WHERE c.id = 5 AND a.catid = c.id
php > echo $q;

UPDATE #__content a
SET hits = 1
FROM #__categories c,#__categories c
WHERE c.id = 5 AND a.catid = c.id AND a.catid = c.id
php > echo $q;

UPDATE #__content a
SET hits = 1
FROM #__categories c,#__categories c,#__categories c
WHERE c.id = 5 AND a.catid = c.id AND a.catid = c.id AND a.catid = c.id
avatar csthomas csthomas - change - 19 Dec 2016
The description was changed
avatar csthomas csthomas - edited - 19 Dec 2016
avatar csthomas csthomas - change - 19 Dec 2016
Title
PostgreSQL - return the same string each time of call __toString() on update query
PostgreSQL - return the same string each time of call __toString() on update query with join
avatar csthomas csthomas - edited - 19 Dec 2016
avatar csthomas csthomas - change - 19 Dec 2016
Title
PostgreSQL - return the same string each time of call __toString() on update query
PostgreSQL - return the same string each time of call __toString() on update query with join
avatar waader
waader - comment - 27 Dec 2016

I have tested this item successfully on 71db6b8

I got always the same malformed query and this patch corrected the problem. Thanks!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13284.

avatar waader waader - test_item - 27 Dec 2016 - Tested successfully
avatar alikon
alikon - comment - 5 Jan 2017

I have tested this item successfully on 71db6b8


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13284.

avatar alikon alikon - test_item - 5 Jan 2017 - Tested successfully
avatar csthomas
csthomas - comment - 5 Jan 2017

Thanks a lot for the tests.

avatar jeckodevelopment jeckodevelopment - change - 5 Jan 2017
Status Pending Ready to Commit
Labels
avatar jeckodevelopment
jeckodevelopment - comment - 5 Jan 2017

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13284.

avatar wilsonge wilsonge - change - 14 Jan 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-01-14 23:58:22
Closed_By wilsonge
avatar wilsonge wilsonge - close - 14 Jan 2017
avatar wilsonge wilsonge - merge - 14 Jan 2017
avatar wilsonge
wilsonge - comment - 14 Jan 2017

Nice catch!! Thanks :)

Add a Comment

Login with GitHub to post a comment