Bug #121305 mysql_query_attribute_string() accepts an INTEGER argument
Description:
mysql_query_attribute_string() successfully initializes and executes when its argument is an INTEGER, although the function requires a string argument. The invalid input is accepted instead of producing the implemented string-argument diagnostic.
Actual result:
The statement completes successfully and returns:
invalid_integer_was_accepted
0
Expected result:
The SELECT must fail during UDF initialization with the implemented diagnostic that mysql_query_attribute_string() expects a string argument. Returning a row is incorrect because the INTEGER argument does not satisfy the function's declared input contract.
Impact:
Callers can supply an unsupported argument type without receiving the required initialization error. The function then executes outside its declared input contract and can return a misleading result. No crash, data loss, or security consequence was observed.
Tested versions:
MySQL Community Server 9.7.2 and 26.7.0.
Environment and configuration:
MySQL Community Server - GPL for Linux on x86_64, source commit e174239c5b3c2bcf164649042ab8a7fc972ce88d. No relevant non-default configuration was recorded. The issue reproduced on both tested versions.
How to repeat:
INSTALL COMPONENT 'file://component_query_attributes';
SELECT mysql_query_attribute_string(123) IS NULL
AS invalid_integer_was_accepted;
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.