odc icon indicating copy to clipboard operation
odc copied to clipboard

[Bug]: A one-line comment in procedure becomes two lines when executing in ODC SQL window

Open alvinloong opened this issue 2 years ago • 0 comments

ODC version

版本号:4.2.3 Server: 4.2.3-20231225 Release Date: 2023-12-25

OB version

Server version: OceanBase 4.2.1.3 (r103030022024011313-c6afef2be5748fc54b1b0159b5224ae288491424) (Built Jan 13 2024 13:36:43)

What happened?

The comment happened to change to two lines after executing the scripts in ODC SQL window:

-- aaa := pn_OperatorID;

changed to

    -- aaa := pn_Operato
ID;

Open the package body DDL in ODC, you can see :

image

What did you expect to happen?

The 'ID' at the end of the comment should NOT be in the next line.

How can we reproduce it (as minimally and precisely as possible)?

Just run following scripts in ODC SQL Window manually, then check the package status.

image

DELIMITER $$
create or replace PACKAGE pkg_test_c IS 
PROCEDURE test
  (
    pn_OperatorID IN INT
  );
END pkg_test_c;
$$

DELIMITER $$
create or replace PACKAGE BODY pkg_test_c IS 
PROCEDURE test
  (
    pn_OperatorID IN INT
  ) IS
  ln_OperatorID INT;
  BEGIN
    -- aaa := pn_OperatorID;
    ln_OperatorID := pn_OperatorID;
  END test;
END pkg_test_c;
$$

DELIMITER ;
SHOW ERRORS;

Anything else we need to know?

Run the scripts manually on obclient command line, it works well:

image

Server version: OceanBase 4.2.1.3 (r103030022024011313-c6afef2be5748fc54b1b0159b5224ae288491424) (Built Jan 13 2024 13:36:43)

Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

obclient [TEST_USER_C]> DELIMITER $$
obclient [TEST_USER_C]> create or replace PACKAGE pkg_test_c IS
    -> PROCEDURE test
    ->   (
    ->     pn_OperatorID IN INT
    ->   );
    -> END pkg_test_c;
    -> $$
Query OK, 0 rows affected (0.148 sec)

obclient [TEST_USER_C]> DELIMITER $$
obclient [TEST_USER_C]> create or replace PACKAGE BODY pkg_test_c IS
    -> PROCEDURE test
    ->   (
    ->     pn_OperatorID IN INT
    ->   ) IS
    ->   ln_OperatorID INT;
    ->   BEGIN
    ->     -- aaa := pn_OperatorID;
    ->     ln_OperatorID := pn_OperatorID;
    ->   END test;
    -> END pkg_test_c;
    -> $$
Query OK, 0 rows affected (0.144 sec)

obclient [TEST_USER_C]>
obclient [TEST_USER_C]> DELIMITER ;
obclient [TEST_USER_C]> SHOW ERRORS;
Empty set (0.352 sec)

Cloud

No response

alvinloong avatar Jan 17 '24 06:01 alvinloong