Bugs item #1685357, was opened at 2007-03-21 16:45
Message generated for change (Comment added) made by nielsnes
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1685357&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Website
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Tobias Scholl (schollt)
>Assigned to: Niels Nes (nielsnes)
Summary: Limitations of Decimal(P,S), Numeric(P,S)

Initial Comment:
If you specify a DECIMAL(P,S) or a NUMERIC(P,S) column in MonetDB, the 
following must hold (if understood correctly in 
MonetDB-SQL/sql/src/server/sql_parser.mx):

* 0 < P(recision) + S(cale) <= 18
* P > S

Therefore you get an error message when you try to create a table like the 
following:

monetdb-> create table tab1 ( col1 decimal(20,0) not null );
Error: decimal(0,20) isn't supported in: "create table tab1 ( col1 
decimal(20,0)"
syntax error, unexpected NOT in: "not"

Adding the limitation in the SQL reference on the data types 
(http://monetdb.cwi.nl/projects/monetdb/SQL/Documentation/Data-Types.html)
would help users to specify datatypes correctly.

While giving the query context in the error message is very useful changing 
"decimal(20,0)" into "decimal(0,20)" is not. Users have no clue why the order 
of P and S has changed.

The following versions

Error: decimal(20,0) isn't supported in: "create table tab1 ( col1 
decimal(20,0) not null );" See SQL-Reference for supported data types.

or

Error: decimal(20,0) isn't supported in: "create table tab1 ( col1 
decimal(20,0) not null );" because P=20 + S=0 > 18.

can be created from the context information during parsing and would give users 
hints how to proceed.

----------------------------------------------------------------------

>Comment By: Niels Nes (nielsnes)
Date: 2007-03-31 08:27

Message:
Logged In: YES 
user_id=43556
Originator: NO

Fixed order of P(recision) and S(cale)  in the parsers error message
(cut/paste bug).
Added message about the additional restriction that P+S should be less
than 18.

Added a test in src/tests/BugTracker/limits_of_decimal.SF-1685357.sql 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1685357&group_id=56967

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to