Issue Details (XML | Word | Printable)

Key: CORE-5903
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Maxim Kuzmin
Votes: 2
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Report name and fact/max length of name of database objects when length exceeding

Created: 28/Aug/18 04:38 AM   Updated: 28/Aug/18 11:27 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

QA Status: No test


 Description  « Hide
When creating various object of database and length thier names exceeding maximal, get error.

Example for package:
CREATE OR ALTER PACKAGE VERY_VERY_LONGEST_NAME_OF_PACKAGE
AS
BEGIN
 
END

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Name longer than database column size.

Example for table:
CREATE TABLE VERY_VERY_LONGEST_NAME_OF_TABLE1 (
    NEW_FIELD INTEGER)

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Name longer than database column size.

Example for exception:
CREATE EXCEPTION VERY_VERY_LONGEST_NAME_OF_EXCEPTION

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Name longer than database column size.

From the message, neither the object type, nor its name, nor its actual length is understood. Sometimes, in executing script or other work, it's causes inconvenience.
Propose extending error message like this:

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Name longer than database column size.
Length name of package "VERY_VERY_LONGEST_NAME_OF_PACKAGE" exceed maximum 31 chars on 2 (fact 33);

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Name longer than database column size.
Length name of table "VERY_VERY_LONGEST_NAME_OF_TABLE1" exceed maximum 31 chars on 1 (fact 32);

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Sean Leyne added a comment - 28/Aug/18 01:03 PM
I don't think it is necessary to report the number of characters that the length exceeds by, the message details should make that obvious.

As for the text of the error message, something more like this would read better:
    Length name of {Object Type} "{Object Name}" ({Length value}) exceeds maximum of {Max Length},

Eg:
    Length name of Table "VERY_VERY_LONGEST_NAME_OF_TABLE1" (32) exceeds maximum of 31


Karol Bieniaszewski added a comment - 28/Aug/18 03:11 PM
Maybe better
Eg:
    Name of Table "VERY_VERY_LONGEST_NAME_OF_TABLE1" (32) exceeds maximum Length of 31

Dmitry Yemanov added a comment - 28/Aug/18 03:27 PM
I'd leave the character counting up to users:
Metadata (or <object>) name "VERY_VERY_LONGEST_NAME_OF_TABLE1" exceeds maximum supported length (31 characters)

Sean Leyne added a comment - 28/Aug/18 04:12 PM
@Dmitry,

If we have the length, what is the harm in providing the value? (It let's the user know by how much the name needs to be trimmed)

_Accurately_, counting 31 characters is one thing, counting 60+ is another.

Maxim Kuzmin added a comment - 28/Aug/18 11:27 PM
@Dmitry Yemanov,

As @Sean Leyne already said, knowledge of the actual length or the number of characters of the excess, simplifies the name adjustment.