inconsistent results in RDS MySQL and RDS proxy

0

hi, we met this inconsistent results in RDS MySQL and RDS proxy, which could be a bug in the RDS proxy.

I created an RDS MySQL 8 and RDS proxy, when I load the same procedure in RDS directly or via RDS proxy, I got different results.

reproduction steps:

  1. create table in RDS
create table a (a int, b datetime);
  1. load procedure to RDS directly
vi rds.sql

DROP PROCEDURE IF EXISTS p002;
delimiter //
CREATE PROCEDURE p002()
BEGIN
    DECLARE c INT;
    INSERT INTO a VALUES(0, CURRENT_TIMESTAMP()),(0, CURRENT_TIMESTAMP()),(0, CURRENT_TIMESTAMP());
    SELECT ROW_COUNT() INTO c;
    SELECT CONCAT('rowcount:', c);
END
//

mysql sbtest -uroot -p -h xxx.rds.amazonaws.com < rds.sql
  1. load procedure to RDS via RDS proxy only procedure name is different.
vi proxy.sql

DROP PROCEDURE IF EXISTS p003;
delimiter //
CREATE PROCEDURE p003()
BEGIN
    DECLARE c INT;
    INSERT INTO a VALUES(0, CURRENT_TIMESTAMP()),(0, CURRENT_TIMESTAMP()),(0, CURRENT_TIMESTAMP());
    SELECT ROW_COUNT() INTO c;
    SELECT CONCAT('rowcount:', c);
END
//

mysql sbtest -uroot -p -h xxx-proxy.rds.amazonaws.com < proxy.sql
  1. call procedure in RDS, but get inconsistent results.
-- RDS
SELECT ROW_COUNT() INTO c;
-- proxy
SELECT 0 INTO c;

the internal function ROW_COUNT() has been change in RDS proxy. Enter image description here

asked a year ago159 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions