You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by de...@db.apache.org on 2004/10/12 06:23:51 UTC

[jira] Created: (DERBY-40) Cannot set default value for BIGINT

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/DERBY-40

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: DERBY-40
    Summary: Cannot set default value for BIGINT
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Derby
   Versions:
             10.0.2.0

   Assignee: 
   Reporter: Weiming YIN

    Created: Mon, 11 Oct 2004 9:22 PM
    Updated: Mon, 11 Oct 2004 9:22 PM
Environment: WINXP+sp2 jdk1.4.2_03, jdk1.3,  Filesystem is NTFS


Description:
I create a table in ij, give a default value for BIGINT type will occur error.

This is my SQL sentence :
   create table test (id BIGINT default 0);

the result is 
   "ERROR 42894: DEFAULT value or IDENTITY attribute value is not valid for column 'ID'."

but the following sql works well.
create table test (id int default 0);



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Re: [PATCH] (DERBY-40) Cannot set default value for BIGINT

Posted by Satheesh Bandaram <sa...@Sourcery.Org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
I have committed this change ...

Satheesh

Sending       
java\engine\org\apache\derby\impl\sql\compile\ColumnDefinitionNode.java
Transmitting file data .
Committed revision 55161.

Army wrote:

> I'm am submitting the following patch as a fix for Derby-40.
>
> Army
>
> Index:
java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java
> ===================================================================
> ---
java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java   
(revision 54741)
> +++
java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java   
(working copy)
> @@ -645,6 +645,14 @@
>              // value if it's integer.
>                  return (defType == StoredFormatIds.INT_TYPE_ID);
>
> +            case StoredFormatIds.LONGINT_TYPE_ID:
> +            // This is a BIGINT column: we allow smallints, ints,
> +            // and big int constants.  Smallint and int literals
> +            // are both covered by INT_TYPE; big int literals are
> +            // covered by LONG_INT type.
> +                return ((defType == StoredFormatIds.INT_TYPE_ID)
> +                    || (defType == StoredFormatIds.LONGINT_TYPE_ID));
> +
>              case StoredFormatIds.DECIMAL_TYPE_ID:
>                  if (defType == StoredFormatIds.DECIMAL_TYPE_ID) {
>                  // only valid if scale and precision are within
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
 
iD8DBQFBdo5oENVNIY6DZ7ERAh53AKCOtNybEngfZbAUg6NQHb2EuYS6+wCgpr4h
Npt54ay7BcBhC6PagpeHXf0=
=y602
-----END PGP SIGNATURE-----


[PATCH] (DERBY-40) Cannot set default value for BIGINT

Posted by Army <ar...@golux.com>.
I'm am submitting the following patch as a fix for Derby-40.

Army

Index: java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java
===================================================================
--- java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java	(revision 54741)
+++ java/engine/org/apache/derby/impl/sql/compile/ColumnDefinitionNode.java	(working copy)
@@ -645,6 +645,14 @@
  			// value if it's integer.
  				return (defType == StoredFormatIds.INT_TYPE_ID);

+			case StoredFormatIds.LONGINT_TYPE_ID:
+			// This is a BIGINT column: we allow smallints, ints,
+			// and big int constants.  Smallint and int literals
+			// are both covered by INT_TYPE; big int literals are
+			// covered by LONG_INT type.
+				return ((defType == StoredFormatIds.INT_TYPE_ID)
+					|| (defType == StoredFormatIds.LONGINT_TYPE_ID));
+
  			case StoredFormatIds.DECIMAL_TYPE_ID:
  				if (defType == StoredFormatIds.DECIMAL_TYPE_ID) {
  				// only valid if scale and precision are within

Re: [jira] Created: (DERBY-40) Cannot set default value for BIGINT

Posted by Army <ar...@golux.com>.
derby-dev@db.apache.org wrote:

> Message:
> 
>   A new issue has been created in JIRA.

[ snip ]

> Description:
> I create a table in ij, give a default value for BIGINT type will occur error.
> 
> This is my SQL sentence :
>    create table test (id BIGINT default 0);
> 
> the result is 
>    "ERROR 42894: DEFAULT value or IDENTITY attribute value is not valid for column 'ID'."

I have a fix for this problem; will post the patch to dev-list soon (after more thorough testing).  I think all the 
types should be covered now...

Army

[jira] Closed: (DERBY-40) Cannot set default value for BIGINT

Posted by de...@db.apache.org.
Message:

   The following issue has been closed.

   Resolver: A B
       Date: Thu, 21 Oct 2004 1:02 PM

Fixed with svn commit 55161
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/DERBY-40

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: DERBY-40
    Summary: Cannot set default value for BIGINT
       Type: Bug

     Status: Closed
   Priority: Major
 Resolution: FIXED

    Project: Derby
   Fix Fors:
             10.0.2.0
   Versions:
             10.0.2.0

   Assignee: A B
   Reporter: Weiming YIN

    Created: Mon, 11 Oct 2004 9:22 PM
    Updated: Thu, 21 Oct 2004 1:02 PM
Environment: WINXP+sp2 jdk1.4.2_03, jdk1.3,  Filesystem is NTFS


Description:
I create a table in ij, give a default value for BIGINT type will occur error.

This is my SQL sentence :
   create table test (id BIGINT default 0);

the result is 
   "ERROR 42894: DEFAULT value or IDENTITY attribute value is not valid for column 'ID'."

but the following sql works well.
create table test (id int default 0);



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-40) Cannot set default value for BIGINT

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-40?page=all ]

Rick Hillegas updated DERBY-40:
-------------------------------

    Component: SQL

Assigning to SQL component.

> Cannot set default value for BIGINT
> -----------------------------------
>
>          Key: DERBY-40
>          URL: http://issues.apache.org/jira/browse/DERBY-40
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.0.2.0
>  Environment: WINXP+sp2 jdk1.4.2_03, jdk1.3,  Filesystem is NTFS
>     Reporter: Weiming YIN
>     Assignee: A B
>      Fix For: 10.0.2.0

>
> I create a table in ij, give a default value for BIGINT type will occur error.
> This is my SQL sentence :
>    create table test (id BIGINT default 0);
> the result is 
>    "ERROR 42894: DEFAULT value or IDENTITY attribute value is not valid for column 'ID'."
> but the following sql works well.
> create table test (id int default 0);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira