在存储过程中我有这样的一些:
SET @input_var1 = 'some1';
SET @input_var2 = 'some2';
SET @query = "SELECT * FROM my_table WHERE my_column = ?";
PREPARE stmt FROM @query;
EXECUTE stmt USING @input_var1;
SET @row_count = ROW_COUNT();
DEALLOCATE PREPARE stmt;
IF(@row_count = 0)THEN
SET @query = "SELECT * FROM my_table WHERE my_column = ?";
PREPARE stmt FROM @query;
EXECUTE stmt USING @input_var2;
SET @row_count = ROW_COUNT();
DEALLOCATE PREPARE stmt;
END IF;
问题:
@row_count始终返回-1
Espected: