Closed (fixed)
Project:
Drupal core
Version:
8.8.x-dev
Component:
database system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Mar 2012 at 10:21 UTC
Updated:
1 Aug 2019 at 12:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
droplet commentedsorry, exclude other patch content
Comment #2
oriol_e9gGood fix!
Comment #3
catchHmm this looks like it could be tested, could we add some?
Comment #4
droplet commentedthe feature only used in SQLite. do a research on Core, we don't test others databases. and no way to force testbot use SQLite ?
Comment #5
droplet commentedit uses first col as classname, @see http://php.net/manual/en/pdostatement.fetch.php
Comment #6
droplet commented"Needs manual testing":
official testbot do not support sqlite :(
Comment #8
droplet commentedAdd a new table so that won't affect other tests.
Comment #9
droplet commentedim not going to remove the comment. add it back :)
Comment #10
droplet commentedComment #11
droplet commentedrun an offline simpletest with sqlite DB and worked.
Comment #12
xjmUntagging per #11. Thanks @droplet!
Comment #13
droplet commented10: sqlite_fetch_fix.patch queued for re-testing.
Comment #15
donquixote commentedComing from #2259947: Minor bug fixes in database system
New patch with changes to #10:
PDOwith\PDO(backslash prepended).Comment #16
donquixote commentedStyle fixes.
Comment #19
donquixote commentedThe relevant fix was this:
The rest is just relocating stuff for aesthetic/conceptual reasons.
Comment #20
ekl1773Rerolled the patch to match new test locations in head. Test files moved to /core/modules/system/src/Tests/Database
Comment #21
clemens.tolboomWhitespace problem
Comment #22
clemens.tolboom(sorry for pasting into the summary)
I came here as we found another bug. Should that be in here as you are writing tests too or should I report a new issue?
$k is not defined there.
Comment #23
jhedstromI marked #1555462: Syntactical errors found in StatementPrefetch as a duplicate. The patch in that issue addresses
$kbeing undefined as mentioned in #22, and that bit should be added to this patch.Comment #24
Katiemouse commentedHi, I am a high school student who is new to drupal. I have attempted to patch the two issues mentioned above :)
Comment #25
benjy commentedThanks @Katiemouse, great work.
Could you please upload a version of the patch with only the test and not the fix. That way we can see that the test fails as expected.
Comment #26
Katiemouse commentedHi this is the test only version :)
Comment #27
droplet commentedI think it should be a new issue and get it move forward faster. Although, it's almost on same class and place, it fixing different bugs.
#24 didn't add a new testcase yet.
Please file a new issue, Thanks. :)
Comment #28
jhedstromMarked #2342191: Subtle bug in Drupal\Core\Database\StatementPrefetch::current() as a duplicate.
If #26 is the test only, it should fail without the fix...
Comment #29
berdirClosed #2679102: Multiple bugs in \Drupal\Core\Database\StatementPrefetch::current and #2499875: Fix bug with prefetch drivers and FETCH_CLASS as duplicates.
Comment #30
catchComment #32
daffie commentedChanged the test a bit. The problem is that the test passes for me on my local machine. The bug of this issue is really a bug. Lets see if it passes on the testbot.
Comment #33
daffie commentedFor the testbot
Comment #35
daffie commentedThe patch with the fix.
Comment #38
daffie commentedMinor change to see if it will fix the MySQL testbot problem.
Comment #40
daffie commentedComment #41
daffie commentedThe patch with the fix and the test passes and the patch with only the test fails.
Ready for a good review.
Comment #47
fabianx commentedRTBC - looks great to me
Comment #48
lendudeNo longer applies, needs a reroll
Comment #49
lendudeRerolled
Comment #50
amateescu commentedThe expected value should be the first parameter passed to
assertIdentical().We should use
assertCount()here.Also, I don't see why we need the extra
$recordsvariable. Can't we just assert the count for$result?Comment #51
maximpodorov commentedThis patch should be added to Drupal 8.7, or the statement of PHP 7.2 compatibility will be false (since passing just one argument to array_unshift is allowed in 7.3 only :) ).
Comment #52
lnunesbrBased on #49, I have backported patch to D7.
Have ran tests locally, apparently looking ok.
Further review and improvements would be much appreciated.
Comment #53
daffie commented@lnunesbr: First the patch for Drupal 8 needs to be committed, before we start with backporting it to Drupal 7.
@maximpodorov: Yes, you are right about array_unshift. The use here of array_unshift is wrong. We are changing it to array_shift.
Comment #54
daffie commentedFixed the remarks from @amateescu. With the exception of removing the
$recordsvariable. I have tried that and anassertCount()with the$resultsvariable does not work.Comment #55
init90Looks good, only small nit: @see link should be \Drupal\Tests\system\Functional\Database\FakeRecord instead of \Drupal\system\Tests\Database\FakeRecord
Comment #56
daffie commented@init90: You are completely right. The class FakeRecord has been moved. Thank you for the good find!
Comment #57
init90Thanks! All main feedbacks were addressed, so set to RTBC.
Comment #58
alexpottCommitted and pushed 6add1ca7a3 to 8.8.x and fb20927037 to 8.7.x. Thanks!
Backported to 8.7.x as this is a major bug and completely broken in HEAD. Nice to have test coverage at last.
Fixed
on commit.