Page MenuHomePhabricator

Add "%Z" (Raw Query) and "%LK" (List of Columns for Keys) to qsprintf()
ClosedPublic

Authored by epriestley on Nov 13 2018, 6:29 PM.
Tags
None
Referenced Files
F13187655: D19800.diff
Sat, May 11, 4:40 AM
Unknown Object (File)
Tue, May 7, 7:51 AM
Unknown Object (File)
Fri, May 3, 7:30 AM
Unknown Object (File)
Thu, May 2, 12:08 AM
Unknown Object (File)
Thu, Apr 25, 6:57 AM
Unknown Object (File)
Thu, Apr 25, 1:35 AM
Unknown Object (File)
Fri, Apr 19, 8:06 PM
Unknown Object (File)
Wed, Apr 17, 1:00 PM
Subscribers
None

Details

Summary

Ref T13217. Ref T13216.

First, we still need a way to pass a raw, unsafe query to qsprintf(...) so we can apply .sql migrations. There's no way to make these "safe" so introduce a new "raw unsafe query" conversion which works like the old %Q: %Z.

Second, when bin/storage adjust adds or modifies keys, it needs to run a query like this:

ALTER TABLE x ADD KEY y (u, w);

The (u, w) part is usually a list of columns (same as %LC) but may look like (u(16), w(64)) if the key is on prefix substrings of the column values.

Introduce %LK to escape this particular kind of column list grammar.

Test Plan

See next revision.

Diff Detail

Repository
rPHU libphutil
Branch
query4
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 21140
Build 28737: Run Core Tests
Build 28736: arc lint + arc unit