[MDEV-4075] Prepare statement wrong argument overflow using UPPER(LEFT(? )) when linked against libmysqlclient-16 or 18 Created: 2013-01-23  Updated: 2013-05-02  Due: 2013-03-18  Resolved: 2013-05-02

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.28a
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: VAROQUI Stephane Assignee: Elena Stepanova
Resolution: Incomplete Votes: 0
Labels: upstream
Environment:

rehl6


Attachments: File Main.cpp.tar.gz    

 Description   

When compiling client over libmysqlclient16 and libmysqlclient18 and

UPPER(LEFT(?))

inside a where clause, such parameter statement parameter is always set to 0 and cause wrong results for the query . Switching back to libmysqlclient15 fixe the issue . The issue is triggered on MySQL and MariaDB client libraries



 Comments   
Comment by VAROQUI Stephane [ 2013-01-23 ]

We can provide a very simple C reproducible test case if that an save you time

Comment by Sergei Golubchik [ 2013-01-27 ]

please, do! You can attach it to the issue.

Comment by Elena Stepanova [ 2013-01-28 ]

Hi Stephane,

Here is what I'm getting with the provided test:

$ ./mdev-4075
One:Exec OK
One:Fetch OK 1

$ ldd ./mdev-4075
linux-vdso.so.1 => (0x00007fff795ff000)
libmysqlclient.so.16 => /usr/lib/libmysqlclient.so.16 (0x00007f923856e000)
libstdc+.so.6 => /usr/lib/x86_64-linux-gnu/libstdc+.so.6 (0x00007f9238267000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9237fe2000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9237dcc000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9237a29000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f923780b000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f92375f3000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9238989000)

General log contents:

7 Prepare SELECT 1 FROM DUAL WHERE UPPER(LEFT('emstoto',3))=UPPER(LEFT(?,3))
7 Execute SELECT 1 FROM DUAL WHERE UPPER(LEFT('emstoto',3))=UPPER(LEFT('ems',3))

So, it looks like everything works as expected. Same with libmysqlclient-18.

Could you please provide the same from your test runs? Test output, ldd, general log.

Thank you.

Comment by Elena Stepanova [ 2013-03-08 ]

Hi Stephane,

You were going to get more information on this, any luck?

Comment by Elena Stepanova [ 2013-05-02 ]

Since there is no new information on the issue, I will close it for now. Please re-open (or comment so we could re-open it) if you have any news.
Thanks.

Generated at Thu Feb 08 06:53:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.