<p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p>
<p dir="auto">table.c.name.startswith( table.c.alias) currently fails:</p>
<p dir="auto">File "/usr/lib/python2.4/site-packages/sqlalchemy/sql.py", line 568, in endswith<br>
return self._compare('LIKE', "%" + other)<br>
TypeError: cannot concatenate 'str' and 'Column' objects</p>
<p dir="auto">here a possible patch.</p>
<hr>
<p dir="auto">Attachments: <a href="../wiki/imported_issue_attachments/470/colexpr.py">colexpr.py</a> | <a href="../wiki/imported_issue_attachments/470/like-endswith-startwith-in.tbz">like-endswith-startwith-in.tbz</a> | <a href="../wiki/imported_issue_attachments/470/like-endswith-startwith.py">like-endswith-startwith.py</a> | <a href="../wiki/imported_issue_attachments/470/like-endswith-startwith-in.py">like-endswith-startwith-in.py</a> | <a href="../wiki/imported_issue_attachments/470/literal4starts-ends-with.4.diff">literal4starts-ends-with.4.diff</a> | <a href="../wiki/imported_issue_attachments/470/literal4starts-ends-with-in.diff">literal4starts-ends-with-in.diff</a> | <a href="../wiki/imported_issue_attachments/470/literal4starts-ends-with.2.diff">literal4starts-ends-with.2.diff</a> | <a href="../wiki/imported_issue_attachments/470/literal4starts-ends-with.diff">literal4starts-ends-with.diff</a> | <a href="../wiki/imported_issue_attachments/470/literal4starts-ends-with.3.diff">literal4starts-ends-with.3.diff</a></p>
<p dir="auto"><strong>Migrated issue, originally created by Jack Zhou (<a href="https://github.com/univerio">@univerio</a>)</strong></p>
<p dir="auto">When using the <code class="notranslate">ON DUPLICATE KEY UPDATE</code> support for MySQL, the <code class="notranslate">.values()</code> generative function is not available, contrary to the claims made by the <a href="http://docs.sqlalchemy.org/en/latest/dialects/mysql.html#mysql-insert-on-duplicate-key-update" rel="nofollow">documentation</a>.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;/usr/lib/python3.5/runpy.py&quot;, line 184, in _run_module_as_main
    &quot;__main__&quot;, mod_spec)
  File &quot;/usr/lib/python3.5/runpy.py&quot;, line 85, in _run_code
    exec(code, run_globals)
  File &quot;kronos/__main__.py&quot;, line 97, in &lt;module&gt;
    cli()
  File &quot;/home/ashu/Documents/kronos/venv/lib/python3.5/site-packages/click/core.py&quot;, line 722, in __call__
    return self.main(*args, **kwargs)
  File &quot;/home/ashu/Documents/kronos/venv/lib/python3.5/site-packages/click/core.py&quot;, line 697, in main
    rv = self.invoke(ctx)
  File &quot;kronos/__main__.py&quot;, line 31, in invoke
    return super(CLI, self).invoke(ctx)
  File &quot;/home/ashu/Documents/kronos/venv/lib/python3.5/site-packages/click/core.py&quot;, line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File &quot;/home/ashu/Documents/kronos/venv/lib/python3.5/site-packages/click/core.py&quot;, line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File &quot;/home/ashu/Documents/kronos/venv/lib/python3.5/site-packages/click/core.py&quot;, line 535, in invoke
    return callback(*args, **kwargs)
  File &quot;/home/ashu/Documents/kronos/scripts/gilmore_from_scratch.py&quot;, line 46, in gilmore_from_scratch
    stmt = insert(GilmoreItem.__table__).values(**to_insert)
TypeError: 'ImmutableColumnCollection' object is not callable"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "kronos/__main__.py", line 97, in &lt;module&gt;
    cli()
  File "/home/ashu/Documents/kronos/venv/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/ashu/Documents/kronos/venv/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "kronos/__main__.py", line 31, in invoke
    return super(CLI, self).invoke(ctx)
  File "/home/ashu/Documents/kronos/venv/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ashu/Documents/kronos/venv/lib/python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ashu/Documents/kronos/venv/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/ashu/Documents/kronos/scripts/gilmore_from_scratch.py", line 46, in gilmore_from_scratch
    stmt = insert(GilmoreItem.__table__).values(**to_insert)
TypeError: 'ImmutableColumnCollection' object is not callable
</code></pre></div>
<p dir="auto">It appears to be shadowed by the <code class="notranslate">.values</code> property intended to support the <code class="notranslate">VALUES(...)</code> construct. Perhaps the column collection could be named <code class="notranslate">values_</code> instead?</p>
<p dir="auto">The workaround is to specify <code class="notranslate">values</code> with the <code class="notranslate">insert</code> constructor:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="stmt = insert(GilmoreItem.__table__, values=to_insert)"><pre class="notranslate"><code class="notranslate">stmt = insert(GilmoreItem.__table__, values=to_insert)
</code></pre></div>