Issue Details (XML | Word | Printable)

Key: PYFB-62
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Pavel Cisar
Reporter: Lele Gaifax
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird driver for Python

Connection.execute_immediate does not respect the sql_dialect

Created: 22/Jan/16 08:48 AM   Updated: 17/Jul/16 09:06 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Environment:
Debian sid
Firebird 2.5


 Description  « Hide
Is there a reason why the execute_immediate() method on the connection does not respect the connection's dialect?

Here is a simple test script:

import unittest
import fdb


class FDBTestCase(unittest.TestCase):
    DB = '/tmp/fdb_test.fdb'
    USER = 'lele'
    PASSWORD = 'lele'
    DIALECT = 3

    def setUp(self):
        try:
            c = fdb.connect(self.DB, user=self.USER, password=self.PASSWORD,
                            sql_dialect=self.DIALECT)
        except:
            pass
        else:
            c.drop_database()

        self.conn = fdb.create_database("create database '{}'"
                                        " user '{}'"
                                        " password '{}'"
                                        .format(self.DB, self.USER, self.PASSWORD),
                                        sql_dialect=self.DIALECT)

    def tearDown(self):
        self.conn.close()

class TestDialect(FDBTestCase):
    def testDialect(self):
        self.assertEqual(self.conn.monitor.db.sql_dialect, self.DIALECT)

class TestExecuteImmediate(FDBTestCase):
    def testCreate(self):
        self.conn.execute_immediate('recreate table t (d date)')
        self.conn.commit()

class TestCursorExecute(FDBTestCase):
    def testCreate(self):
        cur = self.conn.cursor()
        cur.execute('recreate table t (d date)')
        self.conn.commit()

if __name__ == '__main__':
    unittest.main()


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Paulo Freitas added a comment - 17/Jul/16 09:05 AM - edited
Seems to be the same issue I got here: http://tracker.firebirdsql.org/browse/PYFB-38

Currently I'm using fdb 1.6 and I still can't use BIGINT datatype using the connection.execute_immediate() method. I moved on and switched to use a cursor and call the cursor.execute() method, this way everything works fine.