mysql.connector.errors.ProgrammingError: 1052: Column 'date' in field list is ambiguous
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Connector/Python |
Invalid
|
Undecided
|
Unassigned |
Bug Description
CLIENT:
MySQL Connector/Python version 0.3.2
Linux oneoneoh 2.6.18-5-amd64 #1 SMP Mon Dec 3 04:55:28 UTC 2007 x86_64 GNU/Linux
mysql version: 5.0.32-
SERVER:
MySQL version:
5.2.3-MariaDB-
[but the tables in use are not of type mariadb]
Linux oneohone 2.6.18-6-amd64 #1 SMP Fri Dec 12 05:49:32 UTC 2008 x86_64 GNU/Linux
PROBLEM:
This query:
UPDATE myTable, tempTable SET fooCount=
Causes:
mysql.connector
But we tested on the CLIENT in mysql yesterday: "SELECT date from myTable" and it worked without warning/error?!
--> mysql/connector should do the same?!
... or I missed something :)
The error is valid and tells you wat the problem is: you have in both tables the field named 'date' (which is a bad name for a column btw).
Here some more code that shows the exact same error:
def bug797754(): .connect( user='root' ,database= 'test')
cnx = mysql.connector
cur = cnx.cursor() execute( "DROP TABLE IF EXISTS t1") execute( "CREATE TABLE t1 (c1 DATE, c2 DATE)") execute( "UPDATE t1 AS a1, t1 as a2 SET c1 = GREATEST(c1,c2) "
cur.
cur.
cur.
" WHERE a1.c1 = a2.c2")
cur.close()
cnx.close()
Anyway, not a bug, just that the query needs fixing.