Review main Merged

9158[BUGFIX] stdWrap numRows fails due to wrong SELECT clause

Wouter Wolters CR +2 V +2 Normal +124 −1 updated 06/03/13, 20:49

Commit message

Exclude aggregate functions count(), sum(), max(),
min(), avg() in if statement inside
tslib_cObj::sanitizeSelectPart().

Review

  • Code review CR +2
    • Ernesto Baschny +2
    • Wouter Wolters +1
    • Christian Kuhn +1
    • Stefan Neufeind +1
    • Alain +1
  • Verified V +2
    • Ernesto Baschny +2
    • Wouter Wolters +1
    • Christian Kuhn +1
    • Alain +1

Files 2

Review log 63

Show 38 earlier messages
  1. Markus Klein commented on patch set 1 07/23/12, 10:30

    I would prefer that you didn't submit this Hi Wouter, thanks for preparing the path. If you upload somebody else's pacth, please always set the author to the real person, you're the committer. Will correct that now.
  2. Tolleiv Nietsch commented on patch set 2 07/23/12, 10:30

    As Georg mentioned in the issue already - the given crash case doesn't seem to be broken anymore in current master // I'm not able to reproduce the issue - are you?
  3. Markus Klein uploaded patch set 2 07/23/12, 10:30

  4. Georg Ringer commented on patch set 2 07/23/12, 10:30

    someone can then abandon this one?
  5. Marc Wöhlken commented on patch set 3 07/23/12, 10:30

    Verified; Looks good to me, but someone else must approve Tested against V 4.5.13 / 4.5.14
  6. Ernesto Baschny commented on patch set 3 07/23/12, 10:30

    (1 inline comment)
  7. Markus Klein uploaded patch set 4 07/23/12, 10:30

  8. Markus Klein uploaded patch set 5 07/23/12, 10:30

  9. Stefan Neufeind commented on patch set 6 07/23/12, 10:30

    Looks good to me, but someone else must approve Should fix the problem at hand. But wouldn't any other count qualify as well? Like "count(1)" or so?
  10. Markus Klein uploaded patch set 6 07/23/12, 10:30

  11. Markus Klein commented on patch set 6 07/23/12, 10:30

    Verified; Looks good to me, but someone else must approve Removed trailing newline.
  12. Markus Klein commented on patch set 7 07/23/12, 10:30

    Rebased; CGL; Implemented suggestion of Stefan to detect any appearance of count().
  13. Markus Klein uploaded patch set 7 07/23/12, 10:30

  14. Markus Klein uploaded patch set 8 07/23/12, 10:30

  15. Markus Klein commented on patch set 8 07/23/12, 10:30

    (1 inline comment)
  16. Helmut Hummel commented on patch set 3 07/23/12, 10:30

    (1 inline comment)

    class.tslib_content.php:7797

    Could you please add unit tests for this method? #17284 introduced this regression and we had problems with that part also in #29783 Thanks
  17. Marcus Krause commented on patch set 3 07/23/12, 10:30

    FYI: pushed existing patch (patch set 2) again but with corrected branches in commit message
  18. Marcus Krause uploaded patch set 3 07/23/12, 10:30

  19. Maik Matthias commented on patch set 2 07/23/12, 10:30

    Verified; Looks good to me, but someone else must approve TYPO3 version 4.5.13 is affected also. The patch works with this version. Not testet with higher versions.
  20. Maik Matthias commented on patch set 6 07/23/12, 10:30

    Verified; Looks good to me, but someone else must approve Tested with TYPO3 4.5.14
  21. Dan Kleine - geb. Untenzu commented on patch set 6 07/23/12, 10:30

    Verified; Looks good to me, but someone else must approve Tested with a broken and nowby fixed installation (4.5.15). Reviewd code looks good to me for all other versions as well.
  22. Mr. Jenkins commented on patch set 1 07/23/12, 10:30

  23. Mr. Jenkins commented on patch set 2 07/23/12, 10:30

  24. Mr. Jenkins commented on patch set 3 07/23/12, 10:30

  25. Mr. Jenkins commented on patch set 6 07/23/12, 10:30

  26. Mr. Jenkins commented on patch set 6 07/23/12, 10:30

    Fails; I would prefer that you didn't submit this Build Failed https://ci.typo3.org/job/typo3-v4-core-gerrit/3744/ : FAILURE
  27. Mr. Jenkins commented on patch set 7 07/23/12, 10:30

    Fails; I would prefer that you didn't submit this Build Failed https://ci.typo3.org/job/typo3-v4-core-gerrit/4007/ : FAILURE
  28. Mr. Jenkins commented on patch set 8 07/23/12, 10:30

  29. Wouter Wolters commented on patch set 1 07/23/12, 10:30

    I didn't checked the patch. Only provided a path for the given solution in forge.
  30. Wouter Wolters commented on patch set 1 07/23/12, 10:30

    Ok, next time when I prepare a patch I will set the correct author.
  31. Wouter Wolters commented on patch set 2 07/23/12, 10:30

    Tested in master and 4.6. Works in both
  32. Wouter Wolters commented on patch set 2 07/23/12, 10:30

    George, in forge there is a discussion going. I will watch the discussion and if it is not a bugfix I abandon this patch:)
  33. Alain commented on patch set 2 07/23/12, 10:30

    Verified; Looks good to me, but someone else must approve Precision: Patch Set 2 solves the issue. Tested on my current 4.6.4 installation and on master 4.7-dev.
  34. Alain commented on patch set 4 07/23/12, 10:30

    Verified; Looks good to me, but someone else must approve Tested with TYPO3 4.6.7
  35. Alain commented on patch set 6 07/23/12, 10:30

    Verified; Looks good to me, but someone else must approve Tested with TYPO3 4.6.7
  36. Nicole Hummel commented on patch set 6 07/23/12, 10:30

    Verified; I would prefer that you didn't submit this

    class.tslib_content.php:7815

    Please insert white spaces and a line break for the second condition to meet the coding guidelines

    class.tslib_content.php:7867

    Maybe this is a better expression preg_match('/count\([^\)]+\)/i', $selectPart) >> It's not meant to be the beginning of the select statement
  37. Nicole Hummel commented on patch set 8 1 comment 07/23/12, 10:30

    I would prefer that you didn't submit this
  38. Ernesto Baschny uploaded patch set 10 07/23/12, 10:30

  1. Stefan Neufeind commented on patch set 9 07/23/12, 10:30

    Looks good to me, but someone else must approve
  2. Helmut Hummel commented on patch set 9 07/23/12, 10:30

    I would prefer that you didn't submit this Until we have at unit tests for this, I'm against merging it. If the unit tests show that not all cases can be covered, I would prefer to remove the sanitizeSelectPart() magic and document the necessity to add the versioning fields by hand in the TypoScript configuration if the WS-Preview is required. Since the original author of bug #17284 used the selectFields for performance: I bet that the additional PHP code which was introduced eats up more performance than is saved by using fields instead of * So it would be probably good to remove that code anyway.
  3. Helmut Hummel commented on patch set 10 07/23/12, 10:30

    OK, but what about the other aggregate functions besides count()? http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html See also note http://forge.typo3.org/issues/17284#note-11
  4. Helmut Hummel uploaded patch set 11 07/23/12, 10:30

  5. Ernesto Baschny uploaded patch set 13 07/23/12, 10:30

  6. Ernesto Baschny commented on patch set 13 07/23/12, 10:30

    Verified; Looks good to me, but someone else must approve Patchset 13 changes: I made the tests only test the bug in question and not also test the whole query parts. This is due to the fact that the "WHERE" part is dependant on your TYPO3 DB (i.e. if you have a page with "uid"=1 in your database), which would require us to mock TYPO3_DB as well. Since we only need to test (for now) the SELECT part (which is statically calculated based solely on $TCA), the unit tests now reflect this. Passed also on Christian Kuhns machine now. :)
  7. Ernesto Baschny commented on patch set 13 V 0 07/23/12, 10:30

    by team member; Looks good to me, approved
  8. Stefan Neufeind commented on patch set 13 07/23/12, 10:30

    Looks good to me, but someone else must approve
  9. Helmut Hummel commented on patch set 12 07/23/12, 10:30

    Verified; Looks good to me, but someone else must approve Although not all aggregate functions are covered, I'm fine with that change Should be document that fact somewhere?
  10. Helmut Hummel uploaded patch set 12 07/23/12, 10:30

  11. Christian Kuhn commented on patch set 12 07/23/12, 10:30

    Fails The 3 tests fail for me.
  12. Christian Kuhn commented on patch set 12 07/23/12, 10:30

    Failing tests: getQuery with data set "testing #17284: adding uid/pid for workspaces" Failed asserting that two arrays are equal. Array ( 'SELECT' =>'header,bodytext, tt_content.u..._state' 'FROM' =>'tt_content' 'WHERE' =>'tt_content.uid=0' 'tt_content.pid IN (1)' 'GROUPBY' =>'' 'ORDERBY' =>'' 'LIMIT' =>'' ) getQuery with data set "testing #17284: no need to add" Failed asserting that two arrays are equal. Array ( 'SELECT' =>'tt_content.*' 'FROM' =>'tt_content' 'WHERE' =>'tt_content.uid=0' 'tt_content.pid IN (1)' 'GROUPBY' =>'' 'ORDERBY' =>'' 'LIMIT' =>'' ) getQuery with data set "testing #17284: no need to add #2" Failed asserting that two arrays are equal. Array ( 'SELECT' =>'*' 'FROM' =>'tt_content' 'WHERE' =>'tt_content.uid=0' 'tt_content.pid IN (1)' 'GROUPBY' =>'' 'ORDERBY' =>'' 'LIMIT' =>'' )
  13. Christian Kuhn commented on patch set 13 07/23/12, 10:30

    Verified; Looks good to me, but someone else must approve Patch now gets +1 on reading and testing for my 5.1 mysql system, reading the code that looks very reasonable and running the tests.
  14. Mattias Nilsson commented on patch set 10 07/23/12, 10:30

    Verified; Looks good to me, but someone else must approve
  15. Fedir RYKHTIK commented on patch set 9 07/23/12, 10:30

    Verified; Looks good to me, but someone else must approve Works on 4.5
  16. Mr. Jenkins commented on patch set 9 07/23/12, 10:30

  17. Mr. Jenkins commented on patch set 10 07/23/12, 10:30

  18. Mr. Jenkins commented on patch set 11 07/23/12, 10:30

  19. Mr. Jenkins commented on patch set 12 07/23/12, 10:30

  20. Mr. Jenkins commented on patch set 13 07/23/12, 10:30

  21. Wouter Wolters commented on patch set 13 07/23/12, 10:30

    Verified; Looks good to me, but someone else must approve
  22. Alain commented on patch set 13 07/23/12, 10:30

    Verified; Looks good to me, but someone else must approve Tested on TYPO3 4.6.10 and MySQL 5.0.32. It works great, thank you.
  23. Nicole Hummel uploaded patch set 9 07/23/12, 10:30

  24. Nicole Hummel commented on patch set 9 07/23/12, 10:30

    Verified; Looks good to me, but someone else must approve
  25. Ernesto Baschny merged patch set 13 07/23/12, 10:30