diff --git a/mysql-test/suite/compat/oracle/r/sp-code.result b/mysql-test/suite/compat/oracle/r/sp-code.result
index 557906a..0cd9e68 100644
--- a/mysql-test/suite/compat/oracle/r/sp-code.result
+++ b/mysql-test/suite/compat/oracle/r/sp-code.result
@@ -1277,3 +1277,29 @@ Pos	Instruction
 28	jump 4
 29	cpop 1
 DROP PROCEDURE p1;
+#
+# MDEV-10598 sql_mode=ORACLE: Variable declarations can go after cursor declarations
+#
+#
+# Cursor declaration and row type declaration in same block
+#
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (1,'a');
+CREATE PROCEDURE p1()
+AS
+CURSOR cur1 IS SELECT a FROM t1;
+rec1 cur1%ROWTYPE;
+BEGIN
+rec1.a:= 10;
+END;
+$$
+SHOW PROCEDURE CODE p1;
+Pos	Instruction
+0	cursor_copy_struct cur1 rec1@0
+1	set rec1@0 NULL
+2	cpush cur1@0
+3	set rec1.a@0["a"] 10
+4	cpop 1
+CALL p1;
+DROP PROCEDURE p1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/r/sp-cursor-decl.result b/mysql-test/suite/compat/oracle/r/sp-cursor-decl.result
index 1e185f7..8ada172 100644
--- a/mysql-test/suite/compat/oracle/r/sp-cursor-decl.result
+++ b/mysql-test/suite/compat/oracle/r/sp-cursor-decl.result
@@ -5,10 +5,10 @@ SET sql_mode=ORACLE;
 #
 # Variable after cursor declaration
 #
-CREATE OR REPLACE TABLE t1 (a INT);
+CREATE TABLE t1 (a INT);
 insert into t1 values (1);
 insert into t1 values (2);
-CREATE or replace PROCEDURE p1
+CREATE PROCEDURE p1
 AS
 CURSOR c IS SELECT a FROM t1;
 var1 varchar(10);
@@ -27,10 +27,10 @@ drop table t1;
 #
 # Variable after condition declaration
 #
-CREATE OR REPLACE TABLE t1 (col1 INT);
+CREATE TABLE t1 (col1 INT);
 insert into t1 values (1);
 create unique index t1_col1 on t1 (col1);
-CREATE or replace PROCEDURE p1
+CREATE PROCEDURE p1
 AS
 dup_key CONDITION FOR SQLSTATE '23000';
 var1 varchar(40);
@@ -52,10 +52,10 @@ drop table t1;
 #
 # Condition after cursor declaration
 #
-CREATE OR REPLACE TABLE t1 (col1 INT);
+CREATE TABLE t1 (col1 INT);
 insert into t1 values (1);
 create unique index t1_col1 on t1 (col1);
-CREATE or replace PROCEDURE p1
+CREATE PROCEDURE p1
 AS
 var1 varchar(40);
 var2 integer;
@@ -79,10 +79,10 @@ drop table t1;
 #
 # Cursor after handler declaration
 #
-CREATE OR REPLACE TABLE t1 (col1 INT);
+CREATE TABLE t1 (col1 INT);
 insert into t1 values (1);
 create unique index t1_col1 on t1 (col1);
-CREATE or replace PROCEDURE p1
+CREATE PROCEDURE p1
 AS
 var1 varchar(40);
 var2 integer;
@@ -107,10 +107,10 @@ drop table t1;
 #
 # Condition after handler declaration
 #
-CREATE OR REPLACE TABLE t1 (col1 INT);
+CREATE TABLE t1 (col1 INT);
 insert into t1 values (1);
 create unique index t1_col1 on t1 (col1);
-CREATE or replace PROCEDURE p1
+CREATE PROCEDURE p1
 AS
 var1 varchar(40);
 var2 integer;
@@ -135,10 +135,10 @@ drop table t1;
 #
 # Variable after handler declaration
 #
-CREATE OR REPLACE TABLE t1 (col1 INT);
+CREATE TABLE t1 (col1 INT);
 insert into t1 values (1);
 create unique index t1_col1 on t1 (col1);
-CREATE or replace PROCEDURE p1
+CREATE PROCEDURE p1
 AS
 var1 varchar(40);
 var2 integer;
@@ -163,11 +163,11 @@ drop table t1;
 #
 # Variable after cursor (inner block)
 #
-CREATE OR REPLACE TABLE t1 (col1 INT);
+CREATE TABLE t1 (col1 INT);
 insert into t1 values (1);
 insert into t1 values (2);
 create unique index t1_col1 on t1 (col1);
-CREATE or replace PROCEDURE p1
+CREATE PROCEDURE p1
 AS
 CURSOR c IS SELECT col1 FROM t1;
 var1 varchar(40);
@@ -219,7 +219,7 @@ drop table t1;
 #
 CREATE TABLE t1 (a INT, b VARCHAR(10));
 insert into t1 values(1,'a');
-CREATE or replace PROCEDURE p1()
+CREATE PROCEDURE p1()
 AS
 CURSOR cur1 IS SELECT a FROM t1;
 rec1 cur1%ROWTYPE;
@@ -227,18 +227,10 @@ BEGIN
 rec1.a:= 10;
 END;
 $$
-SHOW PROCEDURE CODE p1;
-Pos	Instruction
-0	cursor_copy_struct cur1 rec1@0
-1	set rec1@0 NULL
-2	cpush cur1@0
-3	set rec1.a@0["a"] 10
-4	cpop 1
-currentlty generate error ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT
 call p1;
 DROP PROCEDURE p1;
 drop table t1;
-CREATE or replace PROCEDURE p1
+CREATE PROCEDURE p1
 AS
 a INT:=10;
 CURSOR cur1 IS SELECT a;
@@ -256,7 +248,6 @@ CLOSE cur2;
 SELECT rec2.a;
 END;
 $$
-currentlty generate error ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT
 CALL p1();
 rec1.a
 10
diff --git a/mysql-test/suite/compat/oracle/t/sp-code.test b/mysql-test/suite/compat/oracle/t/sp-code.test
index 00c8109c0..145b848 100644
--- a/mysql-test/suite/compat/oracle/t/sp-code.test
+++ b/mysql-test/suite/compat/oracle/t/sp-code.test
@@ -917,3 +917,29 @@ $$
 DELIMITER ;$$
 SHOW PROCEDURE CODE p1;
 DROP PROCEDURE p1;
+
+
+--echo #
+--echo # MDEV-10598 sql_mode=ORACLE: Variable declarations can go after cursor declarations
+--echo #
+
+--echo #
+--echo # Cursor declaration and row type declaration in same block
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(10));
+INSERT INTO t1 VALUES (1,'a');
+DELIMITER $$;
+CREATE PROCEDURE p1()
+AS
+  CURSOR cur1 IS SELECT a FROM t1;
+  rec1 cur1%ROWTYPE;
+BEGIN
+  rec1.a:= 10;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE p1;
+CALL p1;
+DROP PROCEDURE p1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/sp-cursor-decl.test b/mysql-test/suite/compat/oracle/t/sp-cursor-decl.test
index 0afbd66..91cf94e 100644
--- a/mysql-test/suite/compat/oracle/t/sp-cursor-decl.test
+++ b/mysql-test/suite/compat/oracle/t/sp-cursor-decl.test
@@ -8,11 +8,11 @@ SET sql_mode=ORACLE;
 --echo # Variable after cursor declaration
 --echo #
 
-CREATE OR REPLACE TABLE t1 (a INT);
+CREATE TABLE t1 (a INT);
 insert into t1 values (1);
 insert into t1 values (2);
 DELIMITER $$;
-CREATE or replace PROCEDURE p1
+CREATE PROCEDURE p1
 AS
   CURSOR c IS SELECT a FROM t1;
   var1 varchar(10);
@@ -32,11 +32,11 @@ drop table t1;
 --echo # Variable after condition declaration
 --echo #
 
-CREATE OR REPLACE TABLE t1 (col1 INT);
+CREATE TABLE t1 (col1 INT);
 insert into t1 values (1);
 create unique index t1_col1 on t1 (col1);
 DELIMITER $$;
-CREATE or replace PROCEDURE p1
+CREATE PROCEDURE p1
 AS
   dup_key CONDITION FOR SQLSTATE '23000';
   var1 varchar(40);
@@ -59,11 +59,11 @@ drop table t1;
 --echo # Condition after cursor declaration
 --echo #
 
-CREATE OR REPLACE TABLE t1 (col1 INT);
+CREATE TABLE t1 (col1 INT);
 insert into t1 values (1);
 create unique index t1_col1 on t1 (col1);
 DELIMITER $$;
-CREATE or replace PROCEDURE p1
+CREATE PROCEDURE p1
 AS
   var1 varchar(40);
   var2 integer;
@@ -88,12 +88,12 @@ drop table t1;
 --echo # Cursor after handler declaration
 --echo #
 
-CREATE OR REPLACE TABLE t1 (col1 INT);
+CREATE TABLE t1 (col1 INT);
 insert into t1 values (1);
 create unique index t1_col1 on t1 (col1);
 DELIMITER $$;
 --error ER_PARSE_ERROR
-CREATE or replace PROCEDURE p1
+CREATE PROCEDURE p1
 AS
   var1 varchar(40);
   var2 integer;
@@ -116,12 +116,12 @@ drop table t1;
 --echo # Condition after handler declaration
 --echo #
 
-CREATE OR REPLACE TABLE t1 (col1 INT);
+CREATE TABLE t1 (col1 INT);
 insert into t1 values (1);
 create unique index t1_col1 on t1 (col1);
 DELIMITER $$;
 --error ER_PARSE_ERROR
-CREATE or replace PROCEDURE p1
+CREATE PROCEDURE p1
 AS
   var1 varchar(40);
   var2 integer;
@@ -145,12 +145,12 @@ drop table t1;
 --echo # Variable after handler declaration
 --echo #
 
-CREATE OR REPLACE TABLE t1 (col1 INT);
+CREATE TABLE t1 (col1 INT);
 insert into t1 values (1);
 create unique index t1_col1 on t1 (col1);
 DELIMITER $$;
 --error ER_PARSE_ERROR
-CREATE or replace PROCEDURE p1
+CREATE PROCEDURE p1
 AS
   var1 varchar(40);
   var2 integer;
@@ -174,12 +174,12 @@ drop table t1;
 --echo # Variable after cursor (inner block)
 --echo #
 
-CREATE OR REPLACE TABLE t1 (col1 INT);
+CREATE TABLE t1 (col1 INT);
 insert into t1 values (1);
 insert into t1 values (2);
 create unique index t1_col1 on t1 (col1);
 DELIMITER $$;
-CREATE or replace PROCEDURE p1
+CREATE PROCEDURE p1
 AS
   CURSOR c IS SELECT col1 FROM t1;
   var1 varchar(40);
@@ -223,27 +223,26 @@ drop table t1;
 --echo #
 --echo # Cursor declaration and row type declaration in same block
 --echo #
+
 CREATE TABLE t1 (a INT, b VARCHAR(10));
 insert into t1 values(1,'a');
 delimiter $$;
-CREATE or replace PROCEDURE p1()
+CREATE PROCEDURE p1()
 AS
-CURSOR cur1 IS SELECT a FROM t1;
-rec1 cur1%ROWTYPE;
+  CURSOR cur1 IS SELECT a FROM t1;
+  rec1 cur1%ROWTYPE;
 BEGIN
-rec1.a:= 10;
+  rec1.a:= 10;
 END;
 $$
 delimiter ;$$
-SHOW PROCEDURE CODE p1;
---echo currentlty generate error ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT
---disable_warnings
 call p1;
---enable_warnings
 DROP PROCEDURE p1;
 drop table t1;
+
+
 delimiter $$;
-CREATE or replace PROCEDURE p1
+CREATE PROCEDURE p1
 AS
   a INT:=10;
   CURSOR cur1 IS SELECT a;
@@ -262,8 +261,5 @@ BEGIN
 END;
 $$
 DELIMITER ;$$
---echo currentlty generate error ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT
---disable_warnings
 CALL p1();
---enable_warnings
-DROP PROCEDURE p1;
\ No newline at end of file
+DROP PROCEDURE p1;
