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

Make message about missing password being always displayed as reply on attempt to issue CREATE new login without PASSWORD clause [CORE4841] #5137

Closed
firebird-automations opened this issue Jun 15, 2015 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

SQL> create user u01; ------------------------------------------------- [ 1 ]
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Unexpected end of command - line 1, column 13

SQL> create or alter user u01; --------------------------------------- [ 2 ]
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-ALTER USER U01 failed
-ALTER USER requires at least one clause to be specified

SQL> create or alter user u01 firstname 'john'; ---------------------- [ 3 ]
Statement failed, SQLSTATE = 23000
add record error
-validation error for column "PLG$USERS"."PLG$PASSWD", value "*** null ***"

SQL> create user u01 revoke admin role; ------------------------- [ 4 ]
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 17
-revoke

SQL> create or alter user u01 revoke admin role; ------------------------ [ 5 ]
Statement failed, SQLSTATE = 23000
add record error
-validation error for column "PLG$USERS"."PLG$PASSWD", value "*** null ***" // same for 'grant admin role;'

All five messages appear due to missing 'password' clause. Messages in [3] and [5] looks more informative than other, but it would be nice if text will be more appropriate for end-user, like: 'missing password clause' or so.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

> All five messages appear due to missing 'password' clause.

That's not always correct. In case 2 provided error text is absolutely correct - problem is not due to missing password clause but due to missing _any_clause. When parsing create or alter statement we do not know what part of it (create or alter) will be executed, and at least _some_ clause is needed in any case.

What about cases 1 and 4 - look here:
SQL> create table (x int);
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 14
-(
SQL>
Error happened due to missing table name, but error text is 'Token unknown'.
I.e. it makes no sense fixing this for some particular operator, we should change all parser behaviour to have more meaningful diags.

Messages in cases [3] and [5] may be enhanced.

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Pavel not sure when was it fixed but currently in FB4 I get:

SQL> create or alter user u01 firstname 'john';
Statement failed, SQLSTATE = HY000
Password must be specified when creating user
SQL> create or alter user u01 revoke admin role;
Statement failed, SQLSTATE = HY000
Password must be specified when creating user
SQL>

I.e. places where changing diag made sense are already fixed.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 RC 1 [ 10930 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

> places where changing diag made sense are already fixed.

Yes, it is so.
Checked on:
4.0.0.2271 SS; 4.0.0.2265 SS; 4.0.0.2267 CS.
3.0.8.33392 SS; 3.0.8.33390 SC; 3.0.7.33388 CS.
-- all of them OK.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

Fix Version: 3.0.8 [ 10960 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment