Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#26991 closed Bug (fixed)

Check for SQL_AUTO_IS_NULL fails on special database connections

Reported by: Markus Gerards Owned by: nobody
Component: Database layer (models, ORM) Version: 1.10
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

With #24675 a check for SQL_AUTO_IS_NULL is introduced in initializing a MySQL database connection.

I have some special use case here in which this causes an error. I'm connecting via MySQL to an sphinxsearch database. It basically uses the MySQL query language but has some special features. cursor.execute('SELECT @@SQL_AUTO_IS_NULL') returns None and therefore is_sql_auto_is_null_enabled in features.py is failing.

I think a simple check if cursor.fetchone() has a result would solve the problem.

Change History (4)

comment:1 by Tim Graham, 8 years ago

Has patch: set
Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

Does this PR work for you? I'm not sure if a test is feasible.

in reply to:  1 comment:2 by Markus Gerards, 8 years ago

Replying to timgraham:

Does this PR work for you? I'm not sure if a test is feasible.

This works perfectly nice. Thanks!

comment:3 by GitHub <noreply@…>, 8 years ago

Resolution: fixed
Status: newclosed

In d95c669c:

Fixed #26991 -- Fixed a crash in MySQL where SQL_AUTO_IS_NULL doesn't return a result.

comment:4 by Tim Graham <timograham@…>, 8 years ago

In 11c5c3b8:

[1.10.x] Fixed #26991 -- Fixed a crash in MySQL where SELECT @@SQL_AUTO_IS_NULL doesn't return a result.

Backport of 431cbd115b9aac22a539682820742d9966237a84 from master

Note: See TracTickets for help on using tickets.
Back to Top