Bug #111608 mysqlx DevAPI can't deduce bigint

Submitted: 28 Jun 2023 14:54 Modified: 30 Jun 2024 12:22
Reporter: Kenneth Ostrom Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / Python Severity:S2 (Serious)
Version: OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[28 Jun 2023 14:54] Kenneth Ostrom
Description:
The mysqlx api deduces data types, but if it sees an integer it tries to make it a 32 bit integer. In the case of overflow, it just returns an exception dataset immediately.

How to repeat:
import mysqlx

session = mysqlx.get_session({
    'host': 'localhost',
    'port': 33060,
    'user': 'redacted',
    'password': 'redacted',
})

document1 = {
    '_id': 'unique-name-1',
    'small': 888888888,
    'stuff': 'other stuff',
}

document2 = {
    '_id': 'unique-name-2',
    'large': 8888888888,
    'stuff': 'other stuff',
}

try:
    db = session.create_schema('databasename')
except:
    db = session.get_schema('databasename')

try:
    collection = db.create_collection('tablename')
except:
    collection = db.get_collection('tablename')

try:
    collection.add(document1).execute()
    collection.add(document2).execute()
    print('done')
except Exception as e:
    print(type(e))
    print(e)

Suggested fix:
It's deducing types from the document. In the case of an integer type, we either need arbitrarily large integers, or at least automatically swap to bigint if you get an overflow on int.
[31 May 2024 12:22] MySQL Verification Team
Hello Kenneth,

Thank you for the bug report.
Please upgrade to latest version and report us back if issue persist even in latest version along with test case. Thank you.

Regards,
Ashwini Patil
[1 Jul 2024 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.050 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.