Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect error message when create stored procedure fails #1639

Closed
jguerreroyb opened this issue Jun 26, 2019 · 1 comment
Closed

Incorrect error message when create stored procedure fails #1639

jguerreroyb opened this issue Jun 26, 2019 · 1 comment
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/improve-ux Issues relating to improving user experience.

Comments

@jguerreroyb
Copy link

jguerreroyb commented Jun 26, 2019

CREATE OR REPLACE PROCEDURE transfer(INT, INT, DEC)
LANGUAGE plpgsql    
AS $$
BEGIN
-- subtracting the amount from the sender's account 
    UPDATE accounts 
    SET balance = balance - $3
    WHERE id = $1;

-- adding the amount to the receiver's account
    UPDATE accounts 
    SET balance = balance + $3
    WHERE id = $2;

COMMIT;
END;
$$;

results in:

ERROR:  'function' BETA feature is disabled. Use 'FLAGS_ysql_beta_feature_function' or 'FLAGS_ysql_beta_features'

LINE 1: CREATE OR REPLACE PROCEDURE transfer(INT, INT, DEC)

The error message should read:

ERROR:  'function' BETA feature is disabled. To use this feature, set 'ysql_beta_features' yb-tserver gflag to true.
@kmuthukk kmuthukk added the area/ysql Yugabyte SQL (YSQL) label Jun 26, 2019
@rkarthik007 rkarthik007 added the kind/improve-ux Issues relating to improving user experience. label Jun 27, 2019
@d-uspenskiy d-uspenskiy assigned m-iancu and unassigned d-uspenskiy Jun 28, 2019
yugabyte-ci pushed a commit that referenced this issue Jul 2, 2019
Summary:
Make the 'ysql_beta_features' gflag default to 'true'.
Also edit the error message for "beta features disabled" for clarity (as per #1639).

Test Plan:
existing jenkins tests
Manually check for existing clusters by running a 'create function' command (currently a
beta feature). For instance:
```
CREATE OR REPLACE FUNCTION increment(i integer) RETURNS integer AS $$
        BEGIN
                RETURN i + 1;
        END;
$$ LANGUAGE plpgsql;
```
Examples:
1. To enable beta features (default or explicitly set to true on start or create):
```
 ./bin/yb-ctl create
 ./bin/yb-ctl create --tserver_flags="ysql_beta_features=true"
 ./bin/yb-ctl restart --tserver_flags="ysql_beta_features=true"
```
2. To disable beta features (explicitly set to false on start or create)
```
 ./bin/yb-ctl create --tserver_flags="ysql_beta_features=false"
 ./bin/yb-ctl restart --tserver_flags="ysql_beta_features=false"
```

Reviewers: mikhail, kannan, dmitry, neil

Reviewed By: neil

Subscribers: sid, yql

Differential Revision: https://phabricator.dev.yugabyte.com/D6819
@m-iancu
Copy link
Contributor

m-iancu commented Jul 3, 2019

Fixed in 063386a.

@m-iancu m-iancu closed this as completed Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/improve-ux Issues relating to improving user experience.
Projects
None yet
Development

No branches or pull requests

5 participants