Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection.execute_immediate does not respect the sql_dialect [PYFB62] #79

Open
firebird-automations opened this issue Jan 22, 2016 · 1 comment

Comments

@firebird-automations
Copy link

Submitted by: Lele Gaifax (lelit)

Votes: 1

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()

@firebird-automations
Copy link
Author

Commented by: Paulo Freitas (paulofreitas)

Seems to be the same issue I got here: PYFB38

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants