<p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p>
<p dir="auto">AFAIK, '+' symbol only needs to be unquoted to separate form values from URL. But why function _parse_rfc1738_args in sqlalchemy/lib/sqlalchemy/engine/url.py uses unquote_plus on password!? This is wrong, I think.</p>
<p dir="auto">Following lines of code are replacing '+' symbol in password with space causing database connection to eventually fail.</p>
<p dir="auto">if components<a href="'password'">'password'</a> is not None:<br>
components<a href="'password'">'password'</a> = <br>
util.unquote_plus(components<a href="'password'">'password'</a>)</p>
<p dir="auto"><strong>Migrated issue, originally created by Jairo Llopis (<a href="https://github.com/yajo">@yajo</a>)</strong></p>
<p dir="auto">See this union query:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="queries = list()

queries.append(sql.select(
    columns=[
        sql.expression.literal(&quot;column_1&quot;).label(&quot;label_1&quot;),
        sql.expression.literal(&quot;column_2&quot;).label(&quot;label_2&quot;),
    ],
    bind=conn.engine
))

queries.append(sql.select(
    columns=[
        sql.expression.literal(&quot;column_1&quot;),
        sql.expression.literal(&quot;column_2&quot;),
    ],
    bind=conn.engine
))

one = sql.expression.union(*queries)"><pre class="notranslate"><code class="notranslate">queries = list()

queries.append(sql.select(
    columns=[
        sql.expression.literal("column_1").label("label_1"),
        sql.expression.literal("column_2").label("label_2"),
    ],
    bind=conn.engine
))

queries.append(sql.select(
    columns=[
        sql.expression.literal("column_1"),
        sql.expression.literal("column_2"),
    ],
    bind=conn.engine
))

one = sql.expression.union(*queries)
</code></pre></div>
<p dir="auto">It fails with this exception:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="sqlalchemy.exc.ArgumentError: All selectables passed to CompoundSelect must have identical numbers of columns; select #1 has 2 columns, select #2 has 1"><pre class="notranslate"><code class="notranslate">sqlalchemy.exc.ArgumentError: All selectables passed to CompoundSelect must have identical numbers of columns; select #1 has 2 columns, select #2 has 1
</code></pre></div>
<p dir="auto">But both have 2 columns, it's just that the 2nd one is not labeled (because it is not needed in union queries, at least with MySQL).</p>
<p dir="auto"><strong>Workaround:</strong> labeling all columns in 2nd query.</p>
<p dir="auto">Notice that <em>real</em> columns, wich automatically seem to get a name, don't expose this weird behavior.</p>