clean up doubling of percent signs, base on paramstyle alone and make consistent

Issue #3740 resolved
Mike Bayer repo owner created an issue

Currently, literal_column() doubles up percent signs as the base compiler.py level, which is inconsistent with the behavior of text() and column(), which both do it at the per-dialect level. But also, at the per-dialect level, the mysqldb and psycopg2 compilers hardcode this behavior in two separate places for text(), column(), and the modulus operator.

doubling of percents should be done based on paramstyle alone and can be done by default in the base compiler. literal_column() should not unconditionaly double percents as this is legacy behavior.

Comments (8)

  1. Mike Bayer reporter

    Double percent signs based on paramstyle, not dialect

    This patch moves the "doubling" of percent signs into the base compiler and makes it completely a product of whether or not the paramstyle is format/pyformat or not. Without this paramstyle, percent signs are not doubled across text(), literal_column(), and column().

    Change-Id: Ie2f278ab1dbb94b5078f85c0096d74dbfa049197 Fixes: #3740

    → <<cset 8feba9a25f48>>

  2. Nagaraj Tantri

    @zzzeek When would be the Milestone 1.2 released? Because, when I tried to find the release date, there was no information, as we would find in github about the milestone end date.

  3. Mike Bayer reporter
    • changed status to open

    this was not resolved at all, an errant push of a bunch of branches seems to have tripped the resolution here.

  4. Mike Bayer reporter

    we don't at the moment have a fixed timetable for releases either major or minor. However, we are in the 1.1 beta series right now. Typically, 1.2 would not be until sometime in 2017, unless the pace of development were sped up. This is a behavioral change which can break existing code (for example, if someone is relying upon those percent signs being doubled up) so it can't be released in the middle of a series.

  5. Mike Bayer reporter

    Double percent signs based on paramstyle, not dialect

    This patch moves the "doubling" of percent signs into the base compiler and makes it completely a product of whether or not the paramstyle is format/pyformat or not. Without this paramstyle, percent signs are not doubled across text(), literal_column(), and column().

    Change-Id: Ie2f278ab1dbb94b5078f85c0096d74dbfa049197 Fixes: #3740

    → <<cset 86ef507cc73e>>

  6. Log in to comment