Page MenuHomePhabricator

Update PhabricatorLiskDAO::chunkSQL() for new %Q semantics
ClosedPublic

Authored by epriestley on Nov 7 2018, 1:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 4, 9:08 AM
Unknown Object (File)
Mon, Dec 2, 11:48 PM
Unknown Object (File)
Mon, Dec 2, 11:48 PM
Unknown Object (File)
Mon, Dec 2, 11:45 AM
Unknown Object (File)
Mon, Nov 25, 3:02 AM
Unknown Object (File)
Wed, Nov 20, 5:39 PM
Unknown Object (File)
Sun, Nov 17, 1:37 AM
Unknown Object (File)
Wed, Nov 13, 4:15 AM
Subscribers
Restricted Owners Package

Details

Summary

Ref T13217. This method is slightly tricky:

  • We can't safely return a string: return an array instead.
  • It no longer makes sense to accept glue. All callers use ', ' as glue anyway, so hard-code that.

Then convert all callsites.

Test Plan

Browsed around, saw fewer "unsafe" errors in error log.

Diff Detail

Repository
rP Phabricator
Branch
qobject4
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 21099
Build 28676: Run Core Tests
Build 28675: arc lint + arc unit

Event Timeline

Owners added a subscriber: Restricted Owners Package.Nov 7 2018, 1:06 AM
Harbormaster returned this revision to the author for changes because remote builds failed.Nov 7 2018, 1:07 AM
Harbormaster failed remote builds in B21099: Diff 47250!

Tests are likely to fail since this depends on %LQ out of libphutil/ in D19783.

amckinley added inline comments.
src/infrastructure/storage/lisk/PhabricatorLiskDAO.php
218

Another place where a TODO might be appropriate.

244–247

And this is dead code because we're now doing this work inside the %LQ conversion, right?

This revision is now accepted and ready to land.Nov 7 2018, 9:12 PM
epriestley added inline comments.
src/infrastructure/storage/lisk/PhabricatorLiskDAO.php
244–247

Right -- %LQ (or some other %L*) now do the joins safely, and implode(...) is "unsafe".

(We could make this "safe" and keep the semantics, but we'd have to whitelist acceptable glue, and we only ever use , as glue. I'm guessing third-party code has very few chunkSQL() calls since it's mostly an optimization / migration / workaround-for-low-mysql-packet-size thing.)

This revision was automatically updated to reflect the committed changes.