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 Philipp Hug <ph...@hug.cx> on 2004/12/12 21:50:13 UTC

Identifier Limitations - once again

I know this has been discussed before, but there hasn't been a consus if 
those limitations should be extended...
At the moment, I patched Derby to allow longer identifier for 
index/constraint names, because the CMP engine I'm using, uses 
getMaxColumnNameLength() as limitation for index name.
Does anyone know of any metadata attribute that would specify the 
maximum allowed length for an index/constraint name? If there is such an 
attribute, I could live with that and would just fix the CMP engine? 
Otherwise we should really think about extending it to a decent value 
(e.g. 30 or 128).

btw: cloudscape 9 didn't have this limitation, it has been added in 
cloudscape 10/derby

greets
philipp

Re: Identifier Limitations - once again

Posted by Brian McCallister <br...@apache.org>.
On Dec 12, 2004, at 6:15 PM, Jeremy Boynes wrote:

> In conclusion, unless there is a good technical reason to stick with 
> the current limits, I think we should increase them to 128 across the 
> board.

+1 for 128 across the board, asap =)

-Brian


Re: Identifier Limitations - once again

Posted by Jeremy Boynes <jb...@apache.org>.
Philipp Hug wrote:
> I know this has been discussed before, but there hasn't been a consus if 
> those limitations should be extended...

I don't believe we had consensus one way or the other.

IMHO, Derby should not be constrained by the capabilities of other 
products. We need to weigh this based on the problems for users in 
converting any on-disk image to support larger identifiers vs. the 
flexibility in using longer identifiers.

There is no consistency amongst "enterprise" vendors on a limit, with 
neither Oracle or DB2 supporting the specification's limit of 128 
characters across the board.

The ability to support more identifiers (and hence applications) than we 
  can at the moment can only be good for Derby. It will be easier for 
users to port applications from other databases (Oracle, SQL Server, 
MySQL, Cloudscape 9 :-), ...) as well as DB2. For users considering 
future upgrades to other servers this is a relatively minor issue to 
consider (compared to SQL syntax portability, procedure language, 
identity column issues, ...)

On the implementation front, this can be handled as a 'slushy' upgrade, 
with the 10.0 branch supporting the crippled version and others 
supporting longer identifiers unless constrained to 10.0 compatibility.

In conclusion, unless there is a good technical reason to stick with the 
current limits, I think we should increase them to 128 across the board.

--
Jeremy

Re: Identifier Limitations - once again

Posted by RPost <rp...@pacbell.net>.
Are you referring to the limits specified in iapi\reference\DB2Limit.java
such as:

 /* Some identifiers like Constraint name, Cursor name, Function name, Index
name, Trigger name
 * are limited to 18 character in DB2*/
 public static final int DB2_MAX_IDENTIFIER_LENGTH18 = 18;

----- Original Message ----- 
From: "Philipp Hug" <ph...@hug.cx>
To: <de...@db.apache.org>
Sent: Sunday, December 12, 2004 12:50 PM
Subject: Identifier Limitations - once again


> I know this has been discussed before, but there hasn't been a consus if
> those limitations should be extended...
> At the moment, I patched Derby to allow longer identifier for
> index/constraint names, because the CMP engine I'm using, uses
> getMaxColumnNameLength() as limitation for index name.
> Does anyone know of any metadata attribute that would specify the
> maximum allowed length for an index/constraint name? If there is such an
> attribute, I could live with that and would just fix the CMP engine?
> Otherwise we should really think about extending it to a decent value
> (e.g. 30 or 128).
>
> btw: cloudscape 9 didn't have this limitation, it has been added in
> cloudscape 10/derby
>
> greets
> philipp


Re: Identifier Limitations - once again

Posted by Satheesh Bandaram <sa...@Sourcery.Org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
There is metadata API to retrieve maximum lengths allowed (like the one
you mentioned, getMaxColumnNameLength), but there is no way to set the
maximum length. I do agree that maximum length of 18 for a cursor name
or constraint name or index name is pretty restrictive.

Satheesh

Philipp Hug wrote:

> I know this has been discussed before, but there hasn't been a consus
if those limitations should be extended...
> At the moment, I patched Derby to allow longer identifier for
index/constraint names, because the CMP engine I'm using, uses
getMaxColumnNameLength() as limitation for index name.
> Does anyone know of any metadata attribute that would specify the
maximum allowed length for an index/constraint name? If there is such an
attribute, I could live with that and would just fix the CMP engine?
Otherwise we should really think about extending it to a decent value
(e.g. 30 or 128).
>
> btw: cloudscape 9 didn't have this limitation, it has been added in
cloudscape 10/derby
>
> greets
> philipp
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
 
iD8DBQFBvUvEENVNIY6DZ7ERApW1AJ9KMOobSeYfAb3dj4EriSxZqdEjkgCdHxjk
9rK3U3J+3KY9PJxGkF3PSBI=
=kDL8
-----END PGP SIGNATURE-----


Re: [PATCH] Change all Identifier Limitations to 128

Posted by David Sitsky <si...@users.sourceforge.net>.
On Fri, 17 Dec 2004 03:21, Philipp Hug wrote:
> here it is: patch is against trunk in svn revision 111709, because
> svn.apache.org seems to be down at the moment...
> one important thing: please make sure that DB2Limits.java is renamed to
> DerbyLimits.java in subversion and not just deleted and added again..
> otherwise history of the file will be lost
>
> philipp

Just as a complete aside, it might make life a bit easier to review code 
using a proper code reviewing system rather than using an email client.

One possibility might be to use something like Codestriker, which is an 
open-source code reviewing system (disclaimer, I am one of the authors).
See http://codestriker.sourceforge.net for more info.

For this patch submitted by Philipp, I created a topic at:

http://codestriker.sourceforge.net/cgi-bin/codestriker.pl?topic=8845587&action=view

Its not very fast, as its hosted on a Sourceforge server, but speed is not 
an issue when properly deployed.  You can see the diff far more clearly, 
and you can add comments on a per-line basis, emails will get sent 
appropriately, and everything is recorded in the topic, within a database, 
so the author can work through the issues raised, and flag them when they 
are done.

Whenever somebody creates a new patch, they could create a topic and CC the 
derby-dev list, so anybody can come along and review it.

If this is of interest to people, you could deploy Codestriker on a server 
which can access the Derby svn repository (the SF server blocks this), so 
that you can click on the "Line" and "Parallel" links so that you can view 
an entire file with the changes applied, rather than just the diff chunks.  
Check out the following topic to see what I mean:

http://codestriker.sourceforge.net/cgi-bin/codestriker.pl?topic=7063366&action=view

Again, if this is of interest, we could write a Jira plugin module, so that 
whenever a new review was created, we could automatically update the 
appropriate JIRA record, with a link to this review.

Anyway - just my Aussie 2c - for what its worth. :)

-- 
Cheers,
David


Re: [PATCH] Change all Identifier Limitations to 128

Posted by "Lance J. Andersen" <La...@sun.com>.

>>>      
>>>
>>>>If  the changes being made differ from the DB2 limits, and it does
>>>>make sense to change this now that Derby is part of apache, I would
>>>>pull the constants out of DB2Limit.java as this seems confusing from
>>>>the outside looking in.
>>>>        
>>>>
>
>I would actually advise against that, or at least a more controlled
>approach than just changing DB2 to Derby.
>
>The fact that they are marked as DB2 limits indicates why they were put
>in place, this may be useful information in the future. It identifies a
>limit that most likely is soft, rather than inherent in the Derby
>architecture.
>
>So I would say for the 128 identifier limit, it should be moved out of
>DB2Limit, as 128 is inherent to Derby, the system tables are all set at
>128 characters for identifiers. Or maybe it is inherent to the SQL
>standard and thus the limit is described as a SQLStandard limit?
>
>But the other limits, I would leave as DB2Limit constants until someone
>changes them.
>
>  
>

You make a good point.  There are constants that do not begin with DB2_ 
(decimal  type limits for example) already, are these DB2 limits or Derby?

Are there other known changes that can be made as part of this patch to 
revert to the previous values prior to the DB2 limits being implemented?




Re: [PATCH] Change all Identifier Limitations to 128

Posted by Daniel John Debrunner <dj...@debrunners.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lance J. Andersen wrote:
> +1 IMHO.
>
> Regards
> Lance
>
> Philipp Hug wrote:
>
>> Ok, I could create a new patch that also renames DB2_ into DERBY_ and
>> renames DB2Limit into DerbyLimit.
>> How does that sound?
>>
>> philipp
>>
>> Lance J. Andersen wrote:
>>
>>> If  the changes being made differ from the DB2 limits, and it does
>>> make sense to change this now that Derby is part of apache, I would
>>> pull the constants out of DB2Limit.java as this seems confusing from
>>> the outside looking in.

I would actually advise against that, or at least a more controlled
approach than just changing DB2 to Derby.

The fact that they are marked as DB2 limits indicates why they were put
in place, this may be useful information in the future. It identifies a
limit that most likely is soft, rather than inherent in the Derby
architecture.

So I would say for the 128 identifier limit, it should be moved out of
DB2Limit, as 128 is inherent to Derby, the system tables are all set at
128 characters for identifiers. Or maybe it is inherent to the SQL
standard and thus the limit is described as a SQLStandard limit?

But the other limits, I would leave as DB2Limit constants until someone
changes them.

Dan.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBwcJQIv0S4qsbfuQRAvkoAKCSP1Zu21NsfVar7fi9dsQlobJ2YgCeK+Bk
eZe1KXqsQtxHYy9OXlSFECQ=
=hZUv
-----END PGP SIGNATURE-----


Re: [PATCH] Change all Identifier Limitations to 128 - v2

Posted by Daniel John Debrunner <dj...@debrunners.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Philipp Hug wrote:

> you're right. I did also find another place where a DB2 specific
> limitation was specified and moved it into DerbyLimits.java
> dblook.DB2_MAX_NUMBER_OF_TABLES --> DerbyLimits.DERBY_MAX_NUMBER_OF_TABLES
>
> btw: there's a problem with "ant clean":
> it doesn't remove the autogenerated java files like SQLParser.java...
> that's why it still compiled for me, even there were still references to
> DB2Limit :-(
>
> I did update to the latest svn trunk version and created the diff
> against it.

- -1

for reasons given in earlier e-mail, exemplified in the example below
like this, where the comment as to why the limit exists has been removed.

I think the first patch that just changed the identifers to 128
characters is good, and maybe could be improved with moving the 128
identifier length constant out of Db2Limit.

Dan.
PS. ant clobber removes all the generated files, and performs the clean
action.

 public class dblook {

- -	// DB2 enforces a maximum of 30 tables to be specified as part of
- -	// the table list.
- -	public static final int DB2_MAX_NUMBER_OF_TABLES = 30;
- -
- -	private Connection conn;
+    private Connection conn;
 	private static PreparedStatement getColNameFromNumberQuery;

 	// Mappings from id to name for schemas and tables (for ease
@@ -430,7 +427,7 @@
 		while (argIndex < args.length) {

 			if (((args[argIndex].length() > 0) && (args[argIndex].charAt(0) ==
'-')) ||
- -				(++count > DB2_MAX_NUMBER_OF_TABLES))
+				(++count > DerbyLimit.DERBY_MAX_NUMBER_OF_TABLES))



Dan.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBwc2tIv0S4qsbfuQRAl2nAJ9gBAulxg6OLxODJCTt0GRzLmGLYQCgqITU
EwRwQGvQdUYXFM768/1SoTA=
=LZcP
-----END PGP SIGNATURE-----


Re: [PATCH] Change all Identifier Limitations to 128 - v2

Posted by Philipp Hug <ph...@hug.cx>.
you're right. I did also find another place where a DB2 specific 
limitation was specified and moved it into DerbyLimits.java
dblook.DB2_MAX_NUMBER_OF_TABLES --> DerbyLimits.DERBY_MAX_NUMBER_OF_TABLES

btw: there's a problem with "ant clean":
it doesn't remove the autogenerated java files like SQLParser.java...
that's why it still compiled for me, even there were still references to 
DB2Limit :-(

I did update to the latest svn trunk version and created the diff 
against it.

philipp


Re: [PATCH] Change all Identifier Limitations to 128

Posted by RPost <rp...@pacbell.net>.
> Dan wrote:
>
> I would strongly advise against any attempt to do a global search and
> replace. Having renamed this product more times than I care to remember,
> I've found that such generalized cleanups tend to mess things up.

Let me clear up any confusion my comments may have caused.

I didn't propose a global search and replace. Global search and replace is
rarely
appropriate for software for exactly the reasons Dan expoused.

Once software is in production NOTHING should be changed without a
legitimate or demonstrated need. This includes code, terminology and
documentation.

When I said 'if a term is going to be changed it should be changed
globally.' I mean that
all uses of the term need to be examined to see if they need to be changed
also. I only saw
references to 2 java files that would be affected by the proposed patch.

I found 30 files that reference the term 'DB2Limit'. I examined a few of
these and they
clearly need to be changed. In my opinion ALL of the files that include the
term and all
of the references to the term in the files need to be examined to see if
they need to be
changed also. Otherwise this same issue will undoubtedly come up in the
future.

The decision process I would use is:

1. Does the term NEED to be changed? Is it confusing, is there a trademark
issue (DB2), etc.

2. If the answer to #1 is 'no' then leave it alone.

3. If the answer to #1 is 'yes'  then examine each and every reference to
the term and
    change it as needed.



Re: [PATCH] Change all Identifier Limitations to 128

Posted by Daniel John Debrunner <dj...@debrunners.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

RPost wrote:

> I'm all for changing terms if it makes sense but if a term is going to
> be changed it should be changed globally. Let's do it right the first
time.
>
> A quick search of the 'engine' tree with Windows Explorer shows
>
> 1. 30 *.java files with the string 'DB2Limit' in them.
> 2. an additional 74 files with the string 'DB2' in them.
> 3. 223 files with the string 'cloudscape' in them.
>
> These terms also exist in large numbers in the other branches of the
source.
>
> A quick look at several of the files with 'DB2Limit' in them shows that
> they will probably all need to be changed.
>
> Maybe we can add terms like 'DB2', 'cloudscape', etc. to a todo list of
> candidates for cleanup.

I would strongly advise against any attempt to do a global search and
replace. Having renamed this product more times than I care to remember,
I've found that such generalized cleanups tend to mess things up. E.g.
when Cloudscape was a product name and a company name, doing a single
search and replace on Cloudscape ended up with documentation that had a
product name where a company name should be.

In addition, in the code, a comment may be using DB2 or Cloudscape
correctly, and changing it to use Derby may be wrong. They probably do
need to be taken care of on a case by case basis.

E.g. with this totally made up example, you can see changing
DB2 to Derby would be wrong, the comment is correctly describing
what other databases do for reference.

// If NULL is passed in as the length to this SQL function then
// DB2 throws an exception
// Oracle returns NULL

A made up example of where Cloudscape may be the correct term

// this functionality was added in Cloudscape 3.5

Dan.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBwdLxIv0S4qsbfuQRAoWiAJ9S4dH9RQryex5yUSGL7ag8p3ZCxgCfQbeW
bDIJ8lIhOCtjrjxB0BKbcjc=
=Z81N
-----END PGP SIGNATURE-----


Re: [PATCH] Change all Identifier Limitations to 128

Posted by RPost <rp...@pacbell.net>.
I'm all for changing terms if it makes sense but if a term is going to
be changed it should be changed globally. Let's do it right the first time.

A quick search of the 'engine' tree with Windows Explorer shows

1. 30 *.java files with the string 'DB2Limit' in them.
2. an additional 74 files with the string 'DB2' in them.
3. 223 files with the string 'cloudscape' in them.

These terms also exist in large numbers in the other branches of the source.

A quick look at several of the files with 'DB2Limit' in them shows that
they will probably all need to be changed.

Maybe we can add terms like 'DB2', 'cloudscape', etc. to a todo list of
candidates for cleanup.

When a developer modifies a source file to fix a bug or add functionality
they could cleanup these items.

----- Original Message ----- 
From: "Lance J. Andersen" <La...@sun.com>
To: "Philipp Hug" <ph...@hug.cx>
Cc: "Derby Development" <de...@db.apache.org>
Sent: Thursday, December 16, 2004 8:32 AM
Subject: Re: [PATCH] Change all Identifier Limitations to 128


> Hi Phillipp,
>
> Unless i misread the diffs, it looks like there are still some
> references to DB2Limit and constants with DB2_ as the prefix.
>
> Here are a couple of examples.
>
> >Index: java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
> >===================================================================
> >--- java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
(revision 111709)
> >+++ java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
(working copy)
> >@@ -28,7 +28,7 @@
> > import org.apache.derby.iapi.sql.compile.C_NodeTypes;
> >
> > import org.apache.derby.iapi.reference.SQLState;
> >-import org.apache.derby.iapi.reference.DB2Limit;
> >+import org.apache.derby.iapi.reference.DerbyLimit;
> >
> > import org.apache.derby.iapi.sql.ResultSet;
> > import org.apache.derby.iapi.sql.execute.ConstantAction;
> >@@ -126,9 +126,9 @@
> > TypeDescriptor[] types = null;
> > int[] modes = null;
> >
> >- if (paramCount > DB2Limit.DB2_MAX_PARAMS_IN_STORED_PROCEDURE)
> >+ if (paramCount > DerbyLimit.DB2_MAX_PARAMS_IN_STORED_PROCEDURE)
> > throw
StandardException.newException(SQLState.LANG_TOO_MANY_PARAMETERS_FOR_STORED_
PROC,
> >- String.valueOf(DB2Limit.DB2_MAX_PARAMS_IN_STORED_PROCEDURE), aliasName,
String.valueOf(paramCount));
> >+ String.valueOf(DerbyLimit.DB2_MAX_PARAMS_IN_STORED_PROCEDURE),
aliasName, String.valueOf(paramCount));
> >
> >
>
> Is there a reason that this is still DB2_MAX_PARAMS?
>
> > /* identifier() used to be columnName() */
> >- //unqualified column names are limited to 30 characters
> >- columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
> >+ //unqualified column names are limited to 128 characters
> >+ columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
> > ( typeDescriptor = dataTypeDDL()
> > )
> > [ defaultNode = defaultAndConstraints(typeDescriptor, tableElementList,
columnName, autoIncrementInfo) ]
> >@@ -4115,7 +4115,7 @@
> > //limit the qualifiedId to the id length limit passed to this method
> > checkIdentifierLengthLimit(qualifiedId, id_length_limit);
> > if (schemaName != null)
> >- checkIdentifierLengthLimit(schemaName,
DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
> >+ checkIdentifierLengthLimit(schemaName,
DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
> >
> >
>
> DB2Limit is still the class name
>
>
> Regards
> Lance


Re: [PATCH] Change all Identifier Limitations to 128

Posted by Jeffrey Lichtman <sw...@rcn.com>.
>Unless i misread the diffs, it looks like there are still some references 
>to DB2Limit and constants with DB2_ as the prefix.

I also find it odd that the name of the constant contains the value of the 
constant. If there's only going to be one maximum identifier length, 
wouldn't it be better to call it MAX_IDENTIFIER_LENGTH (instead of 
MAX_IDENTIFIER_LENGTH128)?


                        -        Jeff Lichtman
                                 swazoo@rcn.com
                                 Check out Swazoo Koolak's Web Jukebox at
                                 http://swazoo.com/ 


Re: [PATCH] Change all Identifier Limitations to 128

Posted by "Lance J. Andersen" <La...@sun.com>.
Hi Phillipp,

Unless i misread the diffs, it looks like there are still some 
references to DB2Limit and constants with DB2_ as the prefix.

Here are a couple of examples.

>Index: java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
>===================================================================
>--- java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java	(revision 111709)
>+++ java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java	(working copy)
>@@ -28,7 +28,7 @@
> import org.apache.derby.iapi.sql.compile.C_NodeTypes;
> 
> import org.apache.derby.iapi.reference.SQLState;
>-import org.apache.derby.iapi.reference.DB2Limit;
>+import org.apache.derby.iapi.reference.DerbyLimit;
> 
> import org.apache.derby.iapi.sql.ResultSet;
> import org.apache.derby.iapi.sql.execute.ConstantAction;
>@@ -126,9 +126,9 @@
> 				TypeDescriptor[] types = null;
> 				int[] modes = null;
> 
>-				if (paramCount > DB2Limit.DB2_MAX_PARAMS_IN_STORED_PROCEDURE)
>+				if (paramCount > DerbyLimit.DB2_MAX_PARAMS_IN_STORED_PROCEDURE)
> 					throw StandardException.newException(SQLState.LANG_TOO_MANY_PARAMETERS_FOR_STORED_PROC,
>-							String.valueOf(DB2Limit.DB2_MAX_PARAMS_IN_STORED_PROCEDURE), aliasName, String.valueOf(paramCount));
>+							String.valueOf(DerbyLimit.DB2_MAX_PARAMS_IN_STORED_PROCEDURE), aliasName, String.valueOf(paramCount));
>  
>

Is there a reason that this is still DB2_MAX_PARAMS?

> 	/* identifier() used to be columnName() */
>-	//unqualified column names are limited to 30 characters
>-	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) 
>+	//unqualified column names are limited to 128 characters
>+	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) 
> 		( typeDescriptor = dataTypeDDL() 
> 		)
> 	[ defaultNode = defaultAndConstraints(typeDescriptor, tableElementList, columnName, autoIncrementInfo) ]
>@@ -4115,7 +4115,7 @@
> 		//limit the qualifiedId to the id length limit passed to this method
> 		checkIdentifierLengthLimit(qualifiedId, id_length_limit);
> 		if (schemaName != null)
>-			checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>+			checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>  
>

DB2Limit is still the class name


Regards
Lance

Re: [PATCH] Change all Identifier Limitations to 128

Posted by Philipp Hug <ph...@hug.cx>.
here it is: patch is against trunk in svn revision 111709, because 
svn.apache.org seems to be down at the moment...
one important thing: please make sure that DB2Limits.java is renamed to 
DerbyLimits.java in subversion and not just deleted and added again..
otherwise history of the file will be lost

philipp

Lance J. Andersen wrote:

> +1 IMHO.
>
> Regards
> Lance
>
> Philipp Hug wrote:
>
>> Ok, I could create a new patch that also renames DB2_ into DERBY_ and 
>> renames DB2Limit into DerbyLimit.
>> How does that sound?
>>
>> philipp
>>
>> Lance J. Andersen wrote:
>>
>>> If  the changes being made differ from the DB2 limits, and it does 
>>> make sense to change this now that Derby is part of apache, I would 
>>> pull the constants out of DB2Limit.java as this seems confusing from 
>>> the outside looking in.
>>>
>>>
>>>
>>> Philipp Hug wrote:
>>>
>>>> this patch changes maximum length of column names, index/contraint 
>>>> names, cursor names and schema names to 128 and keeps 
>>>> MaxUserNameLength at 30.
>>>> it also fixes the metadata to return correct values
>>>>
>>>> philipp
>>>> Philipp Hug wrote:
>>>>
>>>>> I know this has been discussed before, but there hasn't been a 
>>>>> consus if those limitations should be extended...
>>>>> At the moment, I patched Derby to allow longer identifier for 
>>>>> index/constraint names, because the CMP engine I'm using, uses 
>>>>> getMaxColumnNameLength() as limitation for index name.
>>>>> Does anyone know of any metadata attribute that would specify the 
>>>>> maximum allowed length for an index/constraint name? If there is 
>>>>> such an attribute, I could live with that and would just fix the 
>>>>> CMP engine? Otherwise we should really think about extending it to 
>>>>> a decent value (e.g. 30 or 128).
>>>>>
>>>>> btw: cloudscape 9 didn't have this limitation, it has been added 
>>>>> in cloudscape 10/derby
>>>>>
>>>>> greets
>>>>> philipp
>>>>>
>>>> ------------------------------------------------------------------------ 
>>>>
>>>>
>>>> Index: java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
>>>> ===================================================================
>>>> --- java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj    
>>>> (revision 111709)
>>>> +++ java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj    
>>>> (working copy)
>>>> @@ -2648,8 +2648,8 @@
>>>>     String cursorName = null;
>>>> }
>>>> {
>>>> -    //cursor names are limited to 18 characters
>>>> -    <CURRENT> <OF> cursorName = 
>>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true)
>>>> +    //cursor names are limited to 128 characters
>>>> +    <CURRENT> <OF> cursorName = 
>>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
>>>>     {         return (FromTable) nodeFactory.getNode(
>>>>                                 C_NodeTypes.CURRENT_OF_NODE,
>>>> @@ -3240,8 +3240,8 @@
>>>>     */
>>>>
>>>>     /* identifier() used to be columnName() */
>>>> -    //unqualified column names are limited to 30 characters
>>>> -    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, 
>>>> true) +    //unqualified column names are limited to 128 characters
>>>> +    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, 
>>>> true)         ( typeDescriptor = dataTypeDDL()         )
>>>>     [ defaultNode = defaultAndConstraints(typeDescriptor, 
>>>> tableElementList, columnName, autoIncrementInfo) ]
>>>> @@ -4115,7 +4115,7 @@
>>>>         //limit the qualifiedId to the id length limit passed to 
>>>> this method
>>>>         checkIdentifierLengthLimit(qualifiedId, id_length_limit);
>>>>         if (schemaName != null)
>>>> -            checkIdentifierLengthLimit(schemaName, 
>>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>>> +            checkIdentifierLengthLimit(schemaName, 
>>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>>>>
>>>>         return (TableName) nodeFactory.getNode(
>>>>                                 nodeType,
>>>> @@ -4418,8 +4418,8 @@
>>>> }
>>>> {
>>>>     /* identifier() used to be columnName() */
>>>> -    //unqualified column names are limited to 30 characters
>>>> -    [ <AS> ] columnName = 
>>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>>>> +    //unqualified column names are limited to 128 characters
>>>> +    [ <AS> ] columnName = 
>>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
>>>>     {
>>>>         return columnName;
>>>>     }
>>>> @@ -6402,10 +6402,10 @@
>>>>             columnName = thirdName;
>>>>         }
>>>>
>>>> -        //column name and schema name can not be longer than 30 
>>>> characters and table name can not be longer than 128 characters
>>>> -        checkIdentifierLengthLimit(columnName, 
>>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>>> +        //column name, schema name and table name can not be 
>>>> longer than 128 characters
>>>> +        checkIdentifierLengthLimit(columnName, 
>>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>>>>         if (schemaName != null)
>>>> -            checkIdentifierLengthLimit(schemaName, 
>>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>>> +            checkIdentifierLengthLimit(schemaName, 
>>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>>>>         if (tableName != null)
>>>>             checkIdentifierLengthLimit(tableName, 
>>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>>>>
>>>> @@ -6549,10 +6549,10 @@
>>>>             columnName = thirdName;
>>>>         }
>>>>
>>>> -        //column name and schema name can not be longer than 30 
>>>> characters and correlation name can not be longer than 128 characters
>>>> -        checkIdentifierLengthLimit(columnName, 
>>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>>> +        //column name, schema name and correlation name can not be 
>>>> longer than 128 characters
>>>> +        checkIdentifierLengthLimit(columnName, 
>>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>>>>         if (schemaName != null)
>>>> -            checkIdentifierLengthLimit(schemaName, 
>>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>>> +            checkIdentifierLengthLimit(schemaName, 
>>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>>>>         if (correlationName != null)
>>>>             checkIdentifierLengthLimit(correlationName, 
>>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>>>>         return (OrderByColumn) nodeFactory.getNode(
>>>> @@ -6632,8 +6632,8 @@
>>>> }
>>>> {
>>>>     /* identifier() used to be columnName() */
>>>> -    //unqualified column names are limited to 30 characters
>>>> -    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, 
>>>> true)
>>>> +    //unqualified column names are limited to 128 characters
>>>> +    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, 
>>>> true)
>>>>     {
>>>>         columnList.addElement(columnName);
>>>>     }
>>>> @@ -7681,8 +7681,8 @@
>>>> }
>>>> {
>>>>     /* identifier() used to be columnName() */
>>>> -    //unqualified column names are limited to 30 characters
>>>> -    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, 
>>>> true)
>>>> +    //unqualified column names are limited to 128 characters
>>>> +    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, 
>>>> true)
>>>>     {
>>>>         /*
>>>>         ** Store the column names for the result columns in the
>>>> @@ -7719,7 +7719,7 @@
>>>> }
>>>> {
>>>>     /* identifier never ends with a space; appending a space 
>>>> meaning desc */
>>>> -    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, 
>>>> true) [<ASC> | <DESC> {columnName = columnName + ' ';}]
>>>> +    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, 
>>>> true) [<ASC> | <DESC> {columnName = columnName + ' ';}]
>>>>     {
>>>>         /*
>>>>         ** Store the column names for the index columns in the
>>>> @@ -8310,7 +8310,7 @@
>>>>     ** We are not currently handling character set
>>>>     ** specifications for schema, or schema bodies.
>>>>     */
>>>> -    <SCHEMA> schemaName = 
>>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>>>> +    <SCHEMA> schemaName = 
>>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
>>>>     {
>>>>
>>>>         if (schemaName.startsWith("SYS"))
>>>> @@ -8461,7 +8461,7 @@
>>>>     ** production to get the grammar to work...
>>>>     */
>>>>     [ unique = unique() ] <INDEX>
>>>> -        indexName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) <ON> tableName 
>>>> = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>> +        indexName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) <ON> tableName 
>>>> = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>>                 <LEFT_PAREN> indexColumnList(indexColumnList) 
>>>> <RIGHT_PAREN>
>>>>         [ properties = propertyList()]
>>>>     {
>>>> @@ -8709,7 +8709,7 @@
>>>>     Object[] functionElements = new Object[9];
>>>> }
>>>> {
>>>> -        <FUNCTION> functionName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>>> +        <FUNCTION> functionName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>>         functionElements[0] = functionParameterList()
>>>>         <RETURNS> functionElements[8] = dataTypeCommon()         ( 
>>>> routineElement(false, functionElements) ) +
>>>> @@ -8839,7 +8839,7 @@
>>>>     Vector                refClause = null;
>>>> }
>>>> {
>>>> -    <TRIGGER> triggerName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>>> +    <TRIGGER> triggerName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>>     isBefore = beforeOrAfter()
>>>>         triggerEvent = triggerEvent(triggerColumns)        // { 
>>>> INSERT | DELETE | UPDATE [ colList    ] }
>>>>         <ON> tableName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>> @@ -9491,7 +9491,7 @@
>>>> }
>>>> {
>>>>     /* changed constraintName() to qualifiedName() for compaction */
>>>> -    <CONSTRAINT> constraintName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>>> +    <CONSTRAINT> constraintName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>>     {
>>>>         return constraintName;
>>>>     }
>>>> @@ -9599,7 +9599,7 @@
>>>>     String newIndexName;
>>>> }
>>>> {
>>>> -    <INDEX> oldIndexName = 
>>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true) <TO> 
>>>> newIndexName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true)
>>>> +    <INDEX> oldIndexName = 
>>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) <TO> 
>>>> newIndexName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
>>>>     {
>>>>         QueryTreeNode qtn = nodeFactory.getNode(
>>>>                                 C_NodeTypes.RENAME_NODE,
>>>> @@ -9889,7 +9889,7 @@
>>>>     String schemaName;
>>>> }
>>>> {
>>>> -    schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, 
>>>> true)
>>>> +    schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, 
>>>> true)
>>>>     {
>>>>         return (QueryTreeNode) nodeFactory.getNode(
>>>>                                 C_NodeTypes.SET_SCHEMA_NODE,
>>>> @@ -9917,7 +9917,7 @@
>>>> |    schemaName = string()
>>>>     {
>>>>         /* Max length for schema name is 
>>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128 */
>>>> -        checkIdentifierLengthLimit(schemaName, 
>>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>>> +        checkIdentifierLengthLimit(schemaName, 
>>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>>>>         return (QueryTreeNode) nodeFactory.getNode(
>>>>                                 C_NodeTypes.SET_SCHEMA_NODE,
>>>>                                 schemaName,
>>>> @@ -10456,7 +10456,7 @@
>>>>     String schemaName;
>>>> }
>>>> {
>>>> -    <SCHEMA> schemaName = 
>>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) <RESTRICT>
>>>> +    <SCHEMA> schemaName = 
>>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) <RESTRICT>
>>>>     {
>>>>         QueryTreeNode stmt =  nodeFactory.getNode(
>>>>                             C_NodeTypes.DROP_SCHEMA_NODE,
>>>> @@ -10557,7 +10557,7 @@
>>>>     String newColumnName;
>>>> }
>>>> {
>>>> -    oldColumnName = 
>>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) <TO> 
>>>> newColumnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>>>> +    oldColumnName = 
>>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) <TO> 
>>>> newColumnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, 
>>>> true)
>>>>     {
>>>>         return (QueryTreeNode) nodeFactory.getNode(
>>>>                             C_NodeTypes.RENAME_NODE,
>>>> @@ -10600,7 +10600,7 @@
>>>>         return lockGranularity;
>>>>     }
>>>> |
>>>> -    <ALTER> [ <COLUMN> ] columnName = 
>>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) <SET>
>>>> +    <ALTER> [ <COLUMN> ] columnName = 
>>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) <SET>
>>>>         typeDescriptor = DB2AlterColumn(autoIncrementInfo)
>>>>     {
>>>>         changeType[0] = CreateStatementNode.MODIFY_TYPE;
>>>> @@ -10660,7 +10660,7 @@
>>>>     TableElementNode tn;
>>>> }
>>>> {
>>>> -    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, 
>>>> true) tn = columnAlterClause(columnName)
>>>> +    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, 
>>>> true) tn = columnAlterClause(columnName)
>>>>     {
>>>>         return tn;
>>>>     }
>>>> @@ -10763,7 +10763,7 @@
>>>> {
>>>>     LOOKAHEAD( {getToken(2).kind == CONSTRAINT} )
>>>>     /* changed constraintName() to qualifiedName() for compaction */
>>>> -    <DROP> <CONSTRAINT> constraintName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>>> +    <DROP> <CONSTRAINT> constraintName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>>     {
>>>>         return (TableElementNode) nodeFactory.getNode(
>>>>                         C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
>>>> @@ -10795,7 +10795,7 @@
>>>>     }
>>>> |
>>>>     LOOKAHEAD( {getToken(2).kind == FOREIGN} )
>>>> -        <DROP> <FOREIGN> <KEY> constraintName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>>> +        <DROP> <FOREIGN> <KEY> constraintName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>>     {
>>>>         return (TableElementNode) nodeFactory.getNode(
>>>>                         C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
>>>> @@ -10812,7 +10812,7 @@
>>>>     }
>>>> |
>>>>     LOOKAHEAD( {getToken(2).kind == UNIQUE} )
>>>> -        <DROP> <UNIQUE> constraintName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>>> +        <DROP> <UNIQUE> constraintName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>>     {
>>>>         return (TableElementNode) nodeFactory.getNode(
>>>>                         C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
>>>> @@ -10828,7 +10828,7 @@
>>>>                         );
>>>>     }
>>>> |
>>>> -        <DROP> <CHECK> constraintName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>>> +        <DROP> <CHECK> constraintName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>>     {
>>>>         return (TableElementNode) nodeFactory.getNode(
>>>>                         C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
>>>> @@ -10874,7 +10874,7 @@
>>>>     TableName indexName;
>>>> }
>>>> {
>>>> -    <INDEX> indexName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>>> +    <INDEX> indexName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>>     {
>>>>         return (QueryTreeNode) nodeFactory.getNode(
>>>>                                 C_NodeTypes.DROP_INDEX_NODE,
>>>> @@ -10940,7 +10940,7 @@
>>>>     TableName triggerName;
>>>> }
>>>> {
>>>> -    <TRIGGER> triggerName = 
>>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) +    <TRIGGER> 
>>>> triggerName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) 
>>>>     {
>>>>         return (QueryTreeNode) nodeFactory.getNode(
>>>>                                 C_NodeTypes.DROP_TRIGGER_NODE,
>>>> Index: 
>>>> java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
>>>> ===================================================================
>>>> --- 
>>>> java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java    
>>>> (revision 111709)
>>>> +++ 
>>>> java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java    
>>>> (working copy)
>>>> @@ -1108,7 +1108,7 @@
>>>>      * @return max literal length
>>>>      */
>>>>     public int getMaxColumnNameLength() {
>>>> -        return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30;
>>>> +        return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128;
>>>>     }
>>>>
>>>>     /**
>>>> @@ -1173,7 +1173,7 @@
>>>>      * @return max cursor name length in bytes
>>>>      */
>>>>     public int getMaxCursorNameLength() {
>>>> -        return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18;
>>>> +        return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128;
>>>>     }
>>>>
>>>>     /**
>>>> @@ -1191,7 +1191,7 @@
>>>>      * @return max name length in bytes
>>>>      */
>>>>     public int getMaxSchemaNameLength()  {
>>>> -        return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30;
>>>> +        return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128;
>>>>     }
>>>>
>>>>     /**
>>>> @@ -1274,7 +1274,7 @@
>>>>      * @return max name length  in bytes
>>>>      */
>>>>     public int getMaxUserNameLength() {
>>>> -        return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30;
>>>> +        return DB2Limit.MAX_USERID_LENGTH;
>>>>     }
>>>>
>>>>     
>>>> //---------------------------------------------------------------------- 
>>>>
>>>> Index: java/engine/org/apache/derby/iapi/reference/DB2Limit.java
>>>> ===================================================================
>>>> --- java/engine/org/apache/derby/iapi/reference/DB2Limit.java    
>>>> (revision 111709)
>>>> +++ java/engine/org/apache/derby/iapi/reference/DB2Limit.java    
>>>> (working copy)
>>>> @@ -53,12 +53,7 @@
>>>>     // SQLCAMESSAGE procedure. See org.apache.derby.impl.sql.catalog.
>>>>     public static final int DB2_JCC_MAX_EXCEPTION_PARAM_LENGTH = 2400;
>>>>
>>>> -    /* Some identifiers like Constraint name, Cursor name, 
>>>> Function name, Index name, Trigger name
>>>> -    * are limited to 18 character in DB2*/
>>>> -    public static final int DB2_MAX_IDENTIFIER_LENGTH18 = 18;
>>>> -    /* Some identifiers like Column name, Schema name are limited 
>>>> to 30 characters in DB2*/
>>>> -    public static final int DB2_MAX_IDENTIFIER_LENGTH30 = 30;
>>>> -    /* Some identifiers like Savepoint names, Table names, view 
>>>> names etc are limited to 128 characters in DB2*/
>>>> +    /* Some identifiers like Constraint name, Cursor name, 
>>>> Function name, Index name, Trigger name, Column name, Schema name, 
>>>> Savepoint names, Table names, view names etc are limited to 128 
>>>> characters in DB2*/
>>>>     public static final int DB2_MAX_IDENTIFIER_LENGTH128 = 128;
>>>>     public static final int    DB2_CHAR_MAXWIDTH = 254;
>>>>     public static final int    DB2_VARCHAR_MAXWIDTH = 32672;
>>>>  
>>>>
>

Re: [PATCH] Change all Identifier Limitations to 128

Posted by "Lance J. Andersen" <La...@Sun.COM>.
+1 IMHO.

Regards
Lance

Philipp Hug wrote:

> Ok, I could create a new patch that also renames DB2_ into DERBY_ and 
> renames DB2Limit into DerbyLimit.
> How does that sound?
>
> philipp
>
> Lance J. Andersen wrote:
>
>> If  the changes being made differ from the DB2 limits, and it does 
>> make sense to change this now that Derby is part of apache, I would 
>> pull the constants out of DB2Limit.java as this seems confusing from 
>> the outside looking in.
>>
>>
>>
>> Philipp Hug wrote:
>>
>>> this patch changes maximum length of column names, index/contraint 
>>> names, cursor names and schema names to 128 and keeps 
>>> MaxUserNameLength at 30.
>>> it also fixes the metadata to return correct values
>>>
>>> philipp
>>> Philipp Hug wrote:
>>>
>>>> I know this has been discussed before, but there hasn't been a 
>>>> consus if those limitations should be extended...
>>>> At the moment, I patched Derby to allow longer identifier for 
>>>> index/constraint names, because the CMP engine I'm using, uses 
>>>> getMaxColumnNameLength() as limitation for index name.
>>>> Does anyone know of any metadata attribute that would specify the 
>>>> maximum allowed length for an index/constraint name? If there is 
>>>> such an attribute, I could live with that and would just fix the 
>>>> CMP engine? Otherwise we should really think about extending it to 
>>>> a decent value (e.g. 30 or 128).
>>>>
>>>> btw: cloudscape 9 didn't have this limitation, it has been added in 
>>>> cloudscape 10/derby
>>>>
>>>> greets
>>>> philipp
>>>>
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>> Index: java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
>>> ===================================================================
>>> --- java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj    
>>> (revision 111709)
>>> +++ java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj    
>>> (working copy)
>>> @@ -2648,8 +2648,8 @@
>>>     String cursorName = null;
>>> }
>>> {
>>> -    //cursor names are limited to 18 characters
>>> -    <CURRENT> <OF> cursorName = 
>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true)
>>> +    //cursor names are limited to 128 characters
>>> +    <CURRENT> <OF> cursorName = 
>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
>>>     {         return (FromTable) nodeFactory.getNode(
>>>                                 C_NodeTypes.CURRENT_OF_NODE,
>>> @@ -3240,8 +3240,8 @@
>>>     */
>>>
>>>     /* identifier() used to be columnName() */
>>> -    //unqualified column names are limited to 30 characters
>>> -    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, 
>>> true) +    //unqualified column names are limited to 128 characters
>>> +    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, 
>>> true)         ( typeDescriptor = dataTypeDDL()         )
>>>     [ defaultNode = defaultAndConstraints(typeDescriptor, 
>>> tableElementList, columnName, autoIncrementInfo) ]
>>> @@ -4115,7 +4115,7 @@
>>>         //limit the qualifiedId to the id length limit passed to 
>>> this method
>>>         checkIdentifierLengthLimit(qualifiedId, id_length_limit);
>>>         if (schemaName != null)
>>> -            checkIdentifierLengthLimit(schemaName, 
>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>> +            checkIdentifierLengthLimit(schemaName, 
>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>>>
>>>         return (TableName) nodeFactory.getNode(
>>>                                 nodeType,
>>> @@ -4418,8 +4418,8 @@
>>> }
>>> {
>>>     /* identifier() used to be columnName() */
>>> -    //unqualified column names are limited to 30 characters
>>> -    [ <AS> ] columnName = 
>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>>> +    //unqualified column names are limited to 128 characters
>>> +    [ <AS> ] columnName = 
>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
>>>     {
>>>         return columnName;
>>>     }
>>> @@ -6402,10 +6402,10 @@
>>>             columnName = thirdName;
>>>         }
>>>
>>> -        //column name and schema name can not be longer than 30 
>>> characters and table name can not be longer than 128 characters
>>> -        checkIdentifierLengthLimit(columnName, 
>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>> +        //column name, schema name and table name can not be longer 
>>> than 128 characters
>>> +        checkIdentifierLengthLimit(columnName, 
>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>>>         if (schemaName != null)
>>> -            checkIdentifierLengthLimit(schemaName, 
>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>> +            checkIdentifierLengthLimit(schemaName, 
>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>>>         if (tableName != null)
>>>             checkIdentifierLengthLimit(tableName, 
>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>>>
>>> @@ -6549,10 +6549,10 @@
>>>             columnName = thirdName;
>>>         }
>>>
>>> -        //column name and schema name can not be longer than 30 
>>> characters and correlation name can not be longer than 128 characters
>>> -        checkIdentifierLengthLimit(columnName, 
>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>> +        //column name, schema name and correlation name can not be 
>>> longer than 128 characters
>>> +        checkIdentifierLengthLimit(columnName, 
>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>>>         if (schemaName != null)
>>> -            checkIdentifierLengthLimit(schemaName, 
>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>> +            checkIdentifierLengthLimit(schemaName, 
>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>>>         if (correlationName != null)
>>>             checkIdentifierLengthLimit(correlationName, 
>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>>>         return (OrderByColumn) nodeFactory.getNode(
>>> @@ -6632,8 +6632,8 @@
>>> }
>>> {
>>>     /* identifier() used to be columnName() */
>>> -    //unqualified column names are limited to 30 characters
>>> -    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, 
>>> true)
>>> +    //unqualified column names are limited to 128 characters
>>> +    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, 
>>> true)
>>>     {
>>>         columnList.addElement(columnName);
>>>     }
>>> @@ -7681,8 +7681,8 @@
>>> }
>>> {
>>>     /* identifier() used to be columnName() */
>>> -    //unqualified column names are limited to 30 characters
>>> -    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, 
>>> true)
>>> +    //unqualified column names are limited to 128 characters
>>> +    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, 
>>> true)
>>>     {
>>>         /*
>>>         ** Store the column names for the result columns in the
>>> @@ -7719,7 +7719,7 @@
>>> }
>>> {
>>>     /* identifier never ends with a space; appending a space meaning 
>>> desc */
>>> -    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, 
>>> true) [<ASC> | <DESC> {columnName = columnName + ' ';}]
>>> +    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, 
>>> true) [<ASC> | <DESC> {columnName = columnName + ' ';}]
>>>     {
>>>         /*
>>>         ** Store the column names for the index columns in the
>>> @@ -8310,7 +8310,7 @@
>>>     ** We are not currently handling character set
>>>     ** specifications for schema, or schema bodies.
>>>     */
>>> -    <SCHEMA> schemaName = 
>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>>> +    <SCHEMA> schemaName = 
>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
>>>     {
>>>
>>>         if (schemaName.startsWith("SYS"))
>>> @@ -8461,7 +8461,7 @@
>>>     ** production to get the grammar to work...
>>>     */
>>>     [ unique = unique() ] <INDEX>
>>> -        indexName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) <ON> tableName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>> +        indexName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) <ON> tableName 
>>> = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>                 <LEFT_PAREN> indexColumnList(indexColumnList) 
>>> <RIGHT_PAREN>
>>>         [ properties = propertyList()]
>>>     {
>>> @@ -8709,7 +8709,7 @@
>>>     Object[] functionElements = new Object[9];
>>> }
>>> {
>>> -        <FUNCTION> functionName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>> +        <FUNCTION> functionName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>         functionElements[0] = functionParameterList()
>>>         <RETURNS> functionElements[8] = dataTypeCommon()         ( 
>>> routineElement(false, functionElements) ) +
>>> @@ -8839,7 +8839,7 @@
>>>     Vector                refClause = null;
>>> }
>>> {
>>> -    <TRIGGER> triggerName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>> +    <TRIGGER> triggerName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>     isBefore = beforeOrAfter()
>>>         triggerEvent = triggerEvent(triggerColumns)        // { 
>>> INSERT | DELETE | UPDATE [ colList    ] }
>>>         <ON> tableName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>> @@ -9491,7 +9491,7 @@
>>> }
>>> {
>>>     /* changed constraintName() to qualifiedName() for compaction */
>>> -    <CONSTRAINT> constraintName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>> +    <CONSTRAINT> constraintName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>     {
>>>         return constraintName;
>>>     }
>>> @@ -9599,7 +9599,7 @@
>>>     String newIndexName;
>>> }
>>> {
>>> -    <INDEX> oldIndexName = 
>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true) <TO> 
>>> newIndexName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true)
>>> +    <INDEX> oldIndexName = 
>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) <TO> 
>>> newIndexName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
>>>     {
>>>         QueryTreeNode qtn = nodeFactory.getNode(
>>>                                 C_NodeTypes.RENAME_NODE,
>>> @@ -9889,7 +9889,7 @@
>>>     String schemaName;
>>> }
>>> {
>>> -    schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, 
>>> true)
>>> +    schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, 
>>> true)
>>>     {
>>>         return (QueryTreeNode) nodeFactory.getNode(
>>>                                 C_NodeTypes.SET_SCHEMA_NODE,
>>> @@ -9917,7 +9917,7 @@
>>> |    schemaName = string()
>>>     {
>>>         /* Max length for schema name is 
>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128 */
>>> -        checkIdentifierLengthLimit(schemaName, 
>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>> +        checkIdentifierLengthLimit(schemaName, 
>>> DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>>>         return (QueryTreeNode) nodeFactory.getNode(
>>>                                 C_NodeTypes.SET_SCHEMA_NODE,
>>>                                 schemaName,
>>> @@ -10456,7 +10456,7 @@
>>>     String schemaName;
>>> }
>>> {
>>> -    <SCHEMA> schemaName = 
>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) <RESTRICT>
>>> +    <SCHEMA> schemaName = 
>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) <RESTRICT>
>>>     {
>>>         QueryTreeNode stmt =  nodeFactory.getNode(
>>>                             C_NodeTypes.DROP_SCHEMA_NODE,
>>> @@ -10557,7 +10557,7 @@
>>>     String newColumnName;
>>> }
>>> {
>>> -    oldColumnName = 
>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) <TO> 
>>> newColumnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>>> +    oldColumnName = 
>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) <TO> 
>>> newColumnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
>>>     {
>>>         return (QueryTreeNode) nodeFactory.getNode(
>>>                             C_NodeTypes.RENAME_NODE,
>>> @@ -10600,7 +10600,7 @@
>>>         return lockGranularity;
>>>     }
>>> |
>>> -    <ALTER> [ <COLUMN> ] columnName = 
>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) <SET>
>>> +    <ALTER> [ <COLUMN> ] columnName = 
>>> identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) <SET>
>>>         typeDescriptor = DB2AlterColumn(autoIncrementInfo)
>>>     {
>>>         changeType[0] = CreateStatementNode.MODIFY_TYPE;
>>> @@ -10660,7 +10660,7 @@
>>>     TableElementNode tn;
>>> }
>>> {
>>> -    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, 
>>> true) tn = columnAlterClause(columnName)
>>> +    columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, 
>>> true) tn = columnAlterClause(columnName)
>>>     {
>>>         return tn;
>>>     }
>>> @@ -10763,7 +10763,7 @@
>>> {
>>>     LOOKAHEAD( {getToken(2).kind == CONSTRAINT} )
>>>     /* changed constraintName() to qualifiedName() for compaction */
>>> -    <DROP> <CONSTRAINT> constraintName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>> +    <DROP> <CONSTRAINT> constraintName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>     {
>>>         return (TableElementNode) nodeFactory.getNode(
>>>                         C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
>>> @@ -10795,7 +10795,7 @@
>>>     }
>>> |
>>>     LOOKAHEAD( {getToken(2).kind == FOREIGN} )
>>> -        <DROP> <FOREIGN> <KEY> constraintName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>> +        <DROP> <FOREIGN> <KEY> constraintName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>     {
>>>         return (TableElementNode) nodeFactory.getNode(
>>>                         C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
>>> @@ -10812,7 +10812,7 @@
>>>     }
>>> |
>>>     LOOKAHEAD( {getToken(2).kind == UNIQUE} )
>>> -        <DROP> <UNIQUE> constraintName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>> +        <DROP> <UNIQUE> constraintName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>     {
>>>         return (TableElementNode) nodeFactory.getNode(
>>>                         C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
>>> @@ -10828,7 +10828,7 @@
>>>                         );
>>>     }
>>> |
>>> -        <DROP> <CHECK> constraintName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>> +        <DROP> <CHECK> constraintName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>     {
>>>         return (TableElementNode) nodeFactory.getNode(
>>>                         C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
>>> @@ -10874,7 +10874,7 @@
>>>     TableName indexName;
>>> }
>>> {
>>> -    <INDEX> indexName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>> +    <INDEX> indexName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>>     {
>>>         return (QueryTreeNode) nodeFactory.getNode(
>>>                                 C_NodeTypes.DROP_INDEX_NODE,
>>> @@ -10940,7 +10940,7 @@
>>>     TableName triggerName;
>>> }
>>> {
>>> -    <TRIGGER> triggerName = 
>>> qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) +    <TRIGGER> 
>>> triggerName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) 
>>>     {
>>>         return (QueryTreeNode) nodeFactory.getNode(
>>>                                 C_NodeTypes.DROP_TRIGGER_NODE,
>>> Index: 
>>> java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
>>> ===================================================================
>>> --- 
>>> java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java    
>>> (revision 111709)
>>> +++ 
>>> java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java    
>>> (working copy)
>>> @@ -1108,7 +1108,7 @@
>>>      * @return max literal length
>>>      */
>>>     public int getMaxColumnNameLength() {
>>> -        return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30;
>>> +        return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128;
>>>     }
>>>
>>>     /**
>>> @@ -1173,7 +1173,7 @@
>>>      * @return max cursor name length in bytes
>>>      */
>>>     public int getMaxCursorNameLength() {
>>> -        return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18;
>>> +        return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128;
>>>     }
>>>
>>>     /**
>>> @@ -1191,7 +1191,7 @@
>>>      * @return max name length in bytes
>>>      */
>>>     public int getMaxSchemaNameLength()  {
>>> -        return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30;
>>> +        return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128;
>>>     }
>>>
>>>     /**
>>> @@ -1274,7 +1274,7 @@
>>>      * @return max name length  in bytes
>>>      */
>>>     public int getMaxUserNameLength() {
>>> -        return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30;
>>> +        return DB2Limit.MAX_USERID_LENGTH;
>>>     }
>>>
>>>     
>>> //---------------------------------------------------------------------- 
>>>
>>> Index: java/engine/org/apache/derby/iapi/reference/DB2Limit.java
>>> ===================================================================
>>> --- java/engine/org/apache/derby/iapi/reference/DB2Limit.java    
>>> (revision 111709)
>>> +++ java/engine/org/apache/derby/iapi/reference/DB2Limit.java    
>>> (working copy)
>>> @@ -53,12 +53,7 @@
>>>     // SQLCAMESSAGE procedure. See org.apache.derby.impl.sql.catalog.
>>>     public static final int DB2_JCC_MAX_EXCEPTION_PARAM_LENGTH = 2400;
>>>
>>> -    /* Some identifiers like Constraint name, Cursor name, Function 
>>> name, Index name, Trigger name
>>> -    * are limited to 18 character in DB2*/
>>> -    public static final int DB2_MAX_IDENTIFIER_LENGTH18 = 18;
>>> -    /* Some identifiers like Column name, Schema name are limited 
>>> to 30 characters in DB2*/
>>> -    public static final int DB2_MAX_IDENTIFIER_LENGTH30 = 30;
>>> -    /* Some identifiers like Savepoint names, Table names, view 
>>> names etc are limited to 128 characters in DB2*/
>>> +    /* Some identifiers like Constraint name, Cursor name, Function 
>>> name, Index name, Trigger name, Column name, Schema name, Savepoint 
>>> names, Table names, view names etc are limited to 128 characters in 
>>> DB2*/
>>>     public static final int DB2_MAX_IDENTIFIER_LENGTH128 = 128;
>>>     public static final int    DB2_CHAR_MAXWIDTH = 254;
>>>     public static final int    DB2_VARCHAR_MAXWIDTH = 32672;
>>>  
>>>

Re: [PATCH] Change all Identifier Limitations to 128

Posted by Philipp Hug <ph...@hug.cx>.
Ok, I could create a new patch that also renames DB2_ into DERBY_ and 
renames DB2Limit into DerbyLimit.
How does that sound?

philipp

Lance J. Andersen wrote:

> If  the changes being made differ from the DB2 limits, and it does 
> make sense to change this now that Derby is part of apache, I would 
> pull the constants out of DB2Limit.java as this seems confusing from 
> the outside looking in.
>
>
>
> Philipp Hug wrote:
>
>> this patch changes maximum length of column names, index/contraint 
>> names, cursor names and schema names to 128 and keeps 
>> MaxUserNameLength at 30.
>> it also fixes the metadata to return correct values
>>
>> philipp
>> Philipp Hug wrote:
>>
>>> I know this has been discussed before, but there hasn't been a 
>>> consus if those limitations should be extended...
>>> At the moment, I patched Derby to allow longer identifier for 
>>> index/constraint names, because the CMP engine I'm using, uses 
>>> getMaxColumnNameLength() as limitation for index name.
>>> Does anyone know of any metadata attribute that would specify the 
>>> maximum allowed length for an index/constraint name? If there is 
>>> such an attribute, I could live with that and would just fix the CMP 
>>> engine? Otherwise we should really think about extending it to a 
>>> decent value (e.g. 30 or 128).
>>>
>>> btw: cloudscape 9 didn't have this limitation, it has been added in 
>>> cloudscape 10/derby
>>>
>>> greets
>>> philipp
>>>
>>------------------------------------------------------------------------
>>
>>Index: java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
>>===================================================================
>>--- java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj	(revision 111709)
>>+++ java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj	(working copy)
>>@@ -2648,8 +2648,8 @@
>> 	String cursorName = null;
>> }
>> {
>>-	//cursor names are limited to 18 characters
>>-	<CURRENT> <OF> cursorName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true)
>>+	//cursor names are limited to 128 characters
>>+	<CURRENT> <OF> cursorName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
>> 	{ 
>> 		return (FromTable) nodeFactory.getNode(
>> 								C_NodeTypes.CURRENT_OF_NODE,
>>@@ -3240,8 +3240,8 @@
>> 	*/
>> 
>> 	/* identifier() used to be columnName() */
>>-	//unqualified column names are limited to 30 characters
>>-	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) 
>>+	//unqualified column names are limited to 128 characters
>>+	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) 
>> 		( typeDescriptor = dataTypeDDL() 
>> 		)
>> 	[ defaultNode = defaultAndConstraints(typeDescriptor, tableElementList, columnName, autoIncrementInfo) ]
>>@@ -4115,7 +4115,7 @@
>> 		//limit the qualifiedId to the id length limit passed to this method
>> 		checkIdentifierLengthLimit(qualifiedId, id_length_limit);
>> 		if (schemaName != null)
>>-			checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>+			checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>> 
>> 		return (TableName) nodeFactory.getNode(
>> 								nodeType,
>>@@ -4418,8 +4418,8 @@
>> }
>> {
>> 	/* identifier() used to be columnName() */
>>-	//unqualified column names are limited to 30 characters
>>-	[ <AS> ] columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>>+	//unqualified column names are limited to 128 characters
>>+	[ <AS> ] columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
>> 	{
>> 		return columnName;
>> 	}
>>@@ -6402,10 +6402,10 @@
>> 			columnName = thirdName;
>> 		}
>> 
>>-		//column name and schema name can not be longer than 30 characters and table name can not be longer than 128 characters
>>-		checkIdentifierLengthLimit(columnName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>+		//column name, schema name and table name can not be longer than 128 characters
>>+		checkIdentifierLengthLimit(columnName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>> 		if (schemaName != null)
>>-			checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>+			checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>> 		if (tableName != null)
>> 			checkIdentifierLengthLimit(tableName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>> 
>>@@ -6549,10 +6549,10 @@
>> 			columnName = thirdName;
>> 		}
>> 
>>-		//column name and schema name can not be longer than 30 characters and correlation name can not be longer than 128 characters
>>-		checkIdentifierLengthLimit(columnName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>+		//column name, schema name and correlation name can not be longer than 128 characters
>>+		checkIdentifierLengthLimit(columnName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>> 		if (schemaName != null)
>>-			checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>+			checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>> 		if (correlationName != null)
>> 			checkIdentifierLengthLimit(correlationName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>> 		return (OrderByColumn) nodeFactory.getNode(
>>@@ -6632,8 +6632,8 @@
>> }
>> {
>> 	/* identifier() used to be columnName() */
>>-	//unqualified column names are limited to 30 characters
>>-	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>>+	//unqualified column names are limited to 128 characters
>>+	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
>> 	{
>> 		columnList.addElement(columnName);
>> 	}
>>@@ -7681,8 +7681,8 @@
>> }
>> {
>> 	/* identifier() used to be columnName() */
>>-	//unqualified column names are limited to 30 characters
>>-	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>>+	//unqualified column names are limited to 128 characters
>>+	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
>> 	{
>> 		/*
>> 		** Store the column names for the result columns in the
>>@@ -7719,7 +7719,7 @@
>> }
>> {
>> 	/* identifier never ends with a space; appending a space meaning desc */
>>-	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) [<ASC> | <DESC> {columnName = columnName + ' ';}]
>>+	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) [<ASC> | <DESC> {columnName = columnName + ' ';}]
>> 	{
>> 		/*
>> 		** Store the column names for the index columns in the
>>@@ -8310,7 +8310,7 @@
>> 	** We are not currently handling character set
>> 	** specifications for schema, or schema bodies.
>> 	*/
>>-	<SCHEMA> schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>>+	<SCHEMA> schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
>> 	{
>> 
>> 		if (schemaName.startsWith("SYS"))
>>@@ -8461,7 +8461,7 @@
>> 	** production to get the grammar to work...
>> 	*/
>> 	[ unique = unique() ] <INDEX>
>>-		indexName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) <ON> tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>+		indexName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) <ON> tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>> 				<LEFT_PAREN> indexColumnList(indexColumnList) <RIGHT_PAREN>
>> 		[ properties = propertyList()]
>> 	{
>>@@ -8709,7 +8709,7 @@
>> 	Object[] functionElements = new Object[9];
>> }
>> {
>>-		<FUNCTION> functionName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>+		<FUNCTION> functionName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>> 		functionElements[0] = functionParameterList()
>> 		<RETURNS> functionElements[8] = dataTypeCommon() 
>> 		( routineElement(false, functionElements) ) +
>>@@ -8839,7 +8839,7 @@
>> 	Vector				refClause = null;
>> }
>> {
>>-	<TRIGGER> triggerName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>+	<TRIGGER> triggerName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>> 	isBefore = beforeOrAfter()
>> 		triggerEvent = triggerEvent(triggerColumns)		// { INSERT | DELETE | UPDATE [ colList	] }
>> 		<ON> tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>>@@ -9491,7 +9491,7 @@
>> }
>> {
>> 	/* changed constraintName() to qualifiedName() for compaction */
>>-	<CONSTRAINT> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>+	<CONSTRAINT> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>> 	{
>> 		return constraintName;
>> 	}
>>@@ -9599,7 +9599,7 @@
>> 	String newIndexName;
>> }
>> {
>>-	<INDEX> oldIndexName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true) <TO> newIndexName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true)
>>+	<INDEX> oldIndexName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) <TO> newIndexName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
>> 	{
>> 		QueryTreeNode qtn = nodeFactory.getNode(
>> 								C_NodeTypes.RENAME_NODE,
>>@@ -9889,7 +9889,7 @@
>> 	String schemaName;
>> }
>> {
>>-	schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>>+	schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
>> 	{
>> 		return (QueryTreeNode) nodeFactory.getNode(
>> 								C_NodeTypes.SET_SCHEMA_NODE,
>>@@ -9917,7 +9917,7 @@
>> |	schemaName = string()
>> 	{
>> 		/* Max length for schema name is DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128 */
>>-		checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>>+		checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
>> 		return (QueryTreeNode) nodeFactory.getNode(
>> 								C_NodeTypes.SET_SCHEMA_NODE,
>> 								schemaName,
>>@@ -10456,7 +10456,7 @@
>> 	String schemaName;
>> }
>> {
>>-	<SCHEMA> schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) <RESTRICT>
>>+	<SCHEMA> schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) <RESTRICT>
>> 	{
>> 		QueryTreeNode stmt =  nodeFactory.getNode(
>> 							C_NodeTypes.DROP_SCHEMA_NODE,
>>@@ -10557,7 +10557,7 @@
>> 	String newColumnName;
>> }
>> {
>>-	oldColumnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) <TO> newColumnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>>+	oldColumnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) <TO> newColumnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
>> 	{
>> 		return (QueryTreeNode) nodeFactory.getNode(
>> 							C_NodeTypes.RENAME_NODE,
>>@@ -10600,7 +10600,7 @@
>> 		return lockGranularity;
>> 	}
>> |
>>-	<ALTER> [ <COLUMN> ] columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) <SET>
>>+	<ALTER> [ <COLUMN> ] columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) <SET>
>> 		typeDescriptor = DB2AlterColumn(autoIncrementInfo)
>> 	{
>> 		changeType[0] = CreateStatementNode.MODIFY_TYPE;
>>@@ -10660,7 +10660,7 @@
>> 	TableElementNode tn;
>> }
>> {
>>-	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) tn = columnAlterClause(columnName)
>>+	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) tn = columnAlterClause(columnName)
>> 	{
>> 		return tn;
>> 	}
>>@@ -10763,7 +10763,7 @@
>> {
>> 	LOOKAHEAD( {getToken(2).kind == CONSTRAINT} )
>> 	/* changed constraintName() to qualifiedName() for compaction */
>>-	<DROP> <CONSTRAINT> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>+	<DROP> <CONSTRAINT> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>> 	{
>> 		return (TableElementNode) nodeFactory.getNode(
>> 						C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
>>@@ -10795,7 +10795,7 @@
>> 	}
>> |
>> 	LOOKAHEAD( {getToken(2).kind == FOREIGN} )
>>-        <DROP> <FOREIGN> <KEY> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>+        <DROP> <FOREIGN> <KEY> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>> 	{
>> 		return (TableElementNode) nodeFactory.getNode(
>> 						C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
>>@@ -10812,7 +10812,7 @@
>> 	}
>> |
>> 	LOOKAHEAD( {getToken(2).kind == UNIQUE} )
>>-        <DROP> <UNIQUE> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>+        <DROP> <UNIQUE> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>> 	{
>> 		return (TableElementNode) nodeFactory.getNode(
>> 						C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
>>@@ -10828,7 +10828,7 @@
>> 						);
>> 	}
>> |
>>-        <DROP> <CHECK> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>+        <DROP> <CHECK> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>> 	{
>> 		return (TableElementNode) nodeFactory.getNode(
>> 						C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
>>@@ -10874,7 +10874,7 @@
>> 	TableName indexName;
>> }
>> {
>>-	<INDEX> indexName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>>+	<INDEX> indexName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>> 	{
>> 		return (QueryTreeNode) nodeFactory.getNode(
>> 								C_NodeTypes.DROP_INDEX_NODE,
>>@@ -10940,7 +10940,7 @@
>> 	TableName triggerName;
>> }
>> {
>>-	<TRIGGER> triggerName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) 
>>+	<TRIGGER> triggerName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) 
>> 	{
>> 		return (QueryTreeNode) nodeFactory.getNode(
>> 								C_NodeTypes.DROP_TRIGGER_NODE,
>>Index: java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
>>===================================================================
>>--- java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java	(revision 111709)
>>+++ java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java	(working copy)
>>@@ -1108,7 +1108,7 @@
>>      * @return max literal length
>>      */
>> 	public int getMaxColumnNameLength() {
>>-		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30;
>>+		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128;
>> 	}
>> 
>>     /**
>>@@ -1173,7 +1173,7 @@
>>      * @return max cursor name length in bytes
>>      */
>> 	public int getMaxCursorNameLength() {
>>-		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18;
>>+		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128;
>> 	}
>> 
>>     /**
>>@@ -1191,7 +1191,7 @@
>>      * @return max name length in bytes
>>      */
>> 	public int getMaxSchemaNameLength()  {
>>-		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30;
>>+		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128;
>> 	}
>> 
>>     /**
>>@@ -1274,7 +1274,7 @@
>>      * @return max name length  in bytes
>>      */
>> 	public int getMaxUserNameLength() {
>>-		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30;
>>+		return DB2Limit.MAX_USERID_LENGTH;
>> 	}
>> 
>>     //----------------------------------------------------------------------
>>Index: java/engine/org/apache/derby/iapi/reference/DB2Limit.java
>>===================================================================
>>--- java/engine/org/apache/derby/iapi/reference/DB2Limit.java	(revision 111709)
>>+++ java/engine/org/apache/derby/iapi/reference/DB2Limit.java	(working copy)
>>@@ -53,12 +53,7 @@
>> 	// SQLCAMESSAGE procedure. See org.apache.derby.impl.sql.catalog.
>> 	public static final int DB2_JCC_MAX_EXCEPTION_PARAM_LENGTH = 2400;
>> 
>>-	/* Some identifiers like Constraint name, Cursor name, Function name, Index name, Trigger name
>>-	* are limited to 18 character in DB2*/
>>-	public static final int DB2_MAX_IDENTIFIER_LENGTH18 = 18;
>>-	/* Some identifiers like Column name, Schema name are limited to 30 characters in DB2*/
>>-	public static final int DB2_MAX_IDENTIFIER_LENGTH30 = 30;
>>-	/* Some identifiers like Savepoint names, Table names, view names etc are limited to 128 characters in DB2*/
>>+	/* Some identifiers like Constraint name, Cursor name, Function name, Index name, Trigger name, Column name, Schema name, Savepoint names, Table names, view names etc are limited to 128 characters in DB2*/
>> 	public static final int DB2_MAX_IDENTIFIER_LENGTH128 = 128;
>> 	public static final int	DB2_CHAR_MAXWIDTH = 254;
>> 	public static final int	DB2_VARCHAR_MAXWIDTH = 32672;
>>  
>>

Re: [PATCH] Change all Identifier Limitations to 128

Posted by "Lance J. Andersen" <La...@Sun.COM>.
If  the changes being made differ from the DB2 limits, and it does make 
sense to change this now that Derby is part of apache, I would pull the 
constants out of DB2Limit.java as this seems confusing from the outside 
looking in.



Philipp Hug wrote:

> this patch changes maximum length of column names, index/contraint 
> names, cursor names and schema names to 128 and keeps 
> MaxUserNameLength at 30.
> it also fixes the metadata to return correct values
>
> philipp
> Philipp Hug wrote:
>
>> I know this has been discussed before, but there hasn't been a consus 
>> if those limitations should be extended...
>> At the moment, I patched Derby to allow longer identifier for 
>> index/constraint names, because the CMP engine I'm using, uses 
>> getMaxColumnNameLength() as limitation for index name.
>> Does anyone know of any metadata attribute that would specify the 
>> maximum allowed length for an index/constraint name? If there is such 
>> an attribute, I could live with that and would just fix the CMP 
>> engine? Otherwise we should really think about extending it to a 
>> decent value (e.g. 30 or 128).
>>
>> btw: cloudscape 9 didn't have this limitation, it has been added in 
>> cloudscape 10/derby
>>
>> greets
>> philipp
>>
>------------------------------------------------------------------------
>
>Index: java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
>===================================================================
>--- java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj	(revision 111709)
>+++ java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj	(working copy)
>@@ -2648,8 +2648,8 @@
> 	String cursorName = null;
> }
> {
>-	//cursor names are limited to 18 characters
>-	<CURRENT> <OF> cursorName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true)
>+	//cursor names are limited to 128 characters
>+	<CURRENT> <OF> cursorName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
> 	{ 
> 		return (FromTable) nodeFactory.getNode(
> 								C_NodeTypes.CURRENT_OF_NODE,
>@@ -3240,8 +3240,8 @@
> 	*/
> 
> 	/* identifier() used to be columnName() */
>-	//unqualified column names are limited to 30 characters
>-	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) 
>+	//unqualified column names are limited to 128 characters
>+	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) 
> 		( typeDescriptor = dataTypeDDL() 
> 		)
> 	[ defaultNode = defaultAndConstraints(typeDescriptor, tableElementList, columnName, autoIncrementInfo) ]
>@@ -4115,7 +4115,7 @@
> 		//limit the qualifiedId to the id length limit passed to this method
> 		checkIdentifierLengthLimit(qualifiedId, id_length_limit);
> 		if (schemaName != null)
>-			checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>+			checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
> 
> 		return (TableName) nodeFactory.getNode(
> 								nodeType,
>@@ -4418,8 +4418,8 @@
> }
> {
> 	/* identifier() used to be columnName() */
>-	//unqualified column names are limited to 30 characters
>-	[ <AS> ] columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>+	//unqualified column names are limited to 128 characters
>+	[ <AS> ] columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
> 	{
> 		return columnName;
> 	}
>@@ -6402,10 +6402,10 @@
> 			columnName = thirdName;
> 		}
> 
>-		//column name and schema name can not be longer than 30 characters and table name can not be longer than 128 characters
>-		checkIdentifierLengthLimit(columnName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>+		//column name, schema name and table name can not be longer than 128 characters
>+		checkIdentifierLengthLimit(columnName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
> 		if (schemaName != null)
>-			checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>+			checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
> 		if (tableName != null)
> 			checkIdentifierLengthLimit(tableName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
> 
>@@ -6549,10 +6549,10 @@
> 			columnName = thirdName;
> 		}
> 
>-		//column name and schema name can not be longer than 30 characters and correlation name can not be longer than 128 characters
>-		checkIdentifierLengthLimit(columnName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>+		//column name, schema name and correlation name can not be longer than 128 characters
>+		checkIdentifierLengthLimit(columnName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
> 		if (schemaName != null)
>-			checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>+			checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
> 		if (correlationName != null)
> 			checkIdentifierLengthLimit(correlationName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
> 		return (OrderByColumn) nodeFactory.getNode(
>@@ -6632,8 +6632,8 @@
> }
> {
> 	/* identifier() used to be columnName() */
>-	//unqualified column names are limited to 30 characters
>-	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>+	//unqualified column names are limited to 128 characters
>+	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
> 	{
> 		columnList.addElement(columnName);
> 	}
>@@ -7681,8 +7681,8 @@
> }
> {
> 	/* identifier() used to be columnName() */
>-	//unqualified column names are limited to 30 characters
>-	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>+	//unqualified column names are limited to 128 characters
>+	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
> 	{
> 		/*
> 		** Store the column names for the result columns in the
>@@ -7719,7 +7719,7 @@
> }
> {
> 	/* identifier never ends with a space; appending a space meaning desc */
>-	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) [<ASC> | <DESC> {columnName = columnName + ' ';}]
>+	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) [<ASC> | <DESC> {columnName = columnName + ' ';}]
> 	{
> 		/*
> 		** Store the column names for the index columns in the
>@@ -8310,7 +8310,7 @@
> 	** We are not currently handling character set
> 	** specifications for schema, or schema bodies.
> 	*/
>-	<SCHEMA> schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>+	<SCHEMA> schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
> 	{
> 
> 		if (schemaName.startsWith("SYS"))
>@@ -8461,7 +8461,7 @@
> 	** production to get the grammar to work...
> 	*/
> 	[ unique = unique() ] <INDEX>
>-		indexName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) <ON> tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>+		indexName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) <ON> tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
> 				<LEFT_PAREN> indexColumnList(indexColumnList) <RIGHT_PAREN>
> 		[ properties = propertyList()]
> 	{
>@@ -8709,7 +8709,7 @@
> 	Object[] functionElements = new Object[9];
> }
> {
>-		<FUNCTION> functionName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>+		<FUNCTION> functionName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
> 		functionElements[0] = functionParameterList()
> 		<RETURNS> functionElements[8] = dataTypeCommon() 
> 		( routineElement(false, functionElements) ) +
>@@ -8839,7 +8839,7 @@
> 	Vector				refClause = null;
> }
> {
>-	<TRIGGER> triggerName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>+	<TRIGGER> triggerName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
> 	isBefore = beforeOrAfter()
> 		triggerEvent = triggerEvent(triggerColumns)		// { INSERT | DELETE | UPDATE [ colList	] }
> 		<ON> tableName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
>@@ -9491,7 +9491,7 @@
> }
> {
> 	/* changed constraintName() to qualifiedName() for compaction */
>-	<CONSTRAINT> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>+	<CONSTRAINT> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
> 	{
> 		return constraintName;
> 	}
>@@ -9599,7 +9599,7 @@
> 	String newIndexName;
> }
> {
>-	<INDEX> oldIndexName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true) <TO> newIndexName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18, true)
>+	<INDEX> oldIndexName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) <TO> newIndexName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
> 	{
> 		QueryTreeNode qtn = nodeFactory.getNode(
> 								C_NodeTypes.RENAME_NODE,
>@@ -9889,7 +9889,7 @@
> 	String schemaName;
> }
> {
>-	schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>+	schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
> 	{
> 		return (QueryTreeNode) nodeFactory.getNode(
> 								C_NodeTypes.SET_SCHEMA_NODE,
>@@ -9917,7 +9917,7 @@
> |	schemaName = string()
> 	{
> 		/* Max length for schema name is DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128 */
>-		checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30);
>+		checkIdentifierLengthLimit(schemaName, DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128);
> 		return (QueryTreeNode) nodeFactory.getNode(
> 								C_NodeTypes.SET_SCHEMA_NODE,
> 								schemaName,
>@@ -10456,7 +10456,7 @@
> 	String schemaName;
> }
> {
>-	<SCHEMA> schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) <RESTRICT>
>+	<SCHEMA> schemaName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) <RESTRICT>
> 	{
> 		QueryTreeNode stmt =  nodeFactory.getNode(
> 							C_NodeTypes.DROP_SCHEMA_NODE,
>@@ -10557,7 +10557,7 @@
> 	String newColumnName;
> }
> {
>-	oldColumnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) <TO> newColumnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true)
>+	oldColumnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) <TO> newColumnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true)
> 	{
> 		return (QueryTreeNode) nodeFactory.getNode(
> 							C_NodeTypes.RENAME_NODE,
>@@ -10600,7 +10600,7 @@
> 		return lockGranularity;
> 	}
> |
>-	<ALTER> [ <COLUMN> ] columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) <SET>
>+	<ALTER> [ <COLUMN> ] columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) <SET>
> 		typeDescriptor = DB2AlterColumn(autoIncrementInfo)
> 	{
> 		changeType[0] = CreateStatementNode.MODIFY_TYPE;
>@@ -10660,7 +10660,7 @@
> 	TableElementNode tn;
> }
> {
>-	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30, true) tn = columnAlterClause(columnName)
>+	columnName = identifier(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128, true) tn = columnAlterClause(columnName)
> 	{
> 		return tn;
> 	}
>@@ -10763,7 +10763,7 @@
> {
> 	LOOKAHEAD( {getToken(2).kind == CONSTRAINT} )
> 	/* changed constraintName() to qualifiedName() for compaction */
>-	<DROP> <CONSTRAINT> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>+	<DROP> <CONSTRAINT> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
> 	{
> 		return (TableElementNode) nodeFactory.getNode(
> 						C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
>@@ -10795,7 +10795,7 @@
> 	}
> |
> 	LOOKAHEAD( {getToken(2).kind == FOREIGN} )
>-        <DROP> <FOREIGN> <KEY> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>+        <DROP> <FOREIGN> <KEY> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
> 	{
> 		return (TableElementNode) nodeFactory.getNode(
> 						C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
>@@ -10812,7 +10812,7 @@
> 	}
> |
> 	LOOKAHEAD( {getToken(2).kind == UNIQUE} )
>-        <DROP> <UNIQUE> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>+        <DROP> <UNIQUE> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
> 	{
> 		return (TableElementNode) nodeFactory.getNode(
> 						C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
>@@ -10828,7 +10828,7 @@
> 						);
> 	}
> |
>-        <DROP> <CHECK> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>+        <DROP> <CHECK> constraintName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
> 	{
> 		return (TableElementNode) nodeFactory.getNode(
> 						C_NodeTypes.CONSTRAINT_DEFINITION_NODE,
>@@ -10874,7 +10874,7 @@
> 	TableName indexName;
> }
> {
>-	<INDEX> indexName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18)
>+	<INDEX> indexName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128)
> 	{
> 		return (QueryTreeNode) nodeFactory.getNode(
> 								C_NodeTypes.DROP_INDEX_NODE,
>@@ -10940,7 +10940,7 @@
> 	TableName triggerName;
> }
> {
>-	<TRIGGER> triggerName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18) 
>+	<TRIGGER> triggerName = qualifiedName(DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128) 
> 	{
> 		return (QueryTreeNode) nodeFactory.getNode(
> 								C_NodeTypes.DROP_TRIGGER_NODE,
>Index: java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
>===================================================================
>--- java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java	(revision 111709)
>+++ java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java	(working copy)
>@@ -1108,7 +1108,7 @@
>      * @return max literal length
>      */
> 	public int getMaxColumnNameLength() {
>-		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30;
>+		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128;
> 	}
> 
>     /**
>@@ -1173,7 +1173,7 @@
>      * @return max cursor name length in bytes
>      */
> 	public int getMaxCursorNameLength() {
>-		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH18;
>+		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128;
> 	}
> 
>     /**
>@@ -1191,7 +1191,7 @@
>      * @return max name length in bytes
>      */
> 	public int getMaxSchemaNameLength()  {
>-		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30;
>+		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH128;
> 	}
> 
>     /**
>@@ -1274,7 +1274,7 @@
>      * @return max name length  in bytes
>      */
> 	public int getMaxUserNameLength() {
>-		return DB2Limit.DB2_MAX_IDENTIFIER_LENGTH30;
>+		return DB2Limit.MAX_USERID_LENGTH;
> 	}
> 
>     //----------------------------------------------------------------------
>Index: java/engine/org/apache/derby/iapi/reference/DB2Limit.java
>===================================================================
>--- java/engine/org/apache/derby/iapi/reference/DB2Limit.java	(revision 111709)
>+++ java/engine/org/apache/derby/iapi/reference/DB2Limit.java	(working copy)
>@@ -53,12 +53,7 @@
> 	// SQLCAMESSAGE procedure. See org.apache.derby.impl.sql.catalog.
> 	public static final int DB2_JCC_MAX_EXCEPTION_PARAM_LENGTH = 2400;
> 
>-	/* Some identifiers like Constraint name, Cursor name, Function name, Index name, Trigger name
>-	* are limited to 18 character in DB2*/
>-	public static final int DB2_MAX_IDENTIFIER_LENGTH18 = 18;
>-	/* Some identifiers like Column name, Schema name are limited to 30 characters in DB2*/
>-	public static final int DB2_MAX_IDENTIFIER_LENGTH30 = 30;
>-	/* Some identifiers like Savepoint names, Table names, view names etc are limited to 128 characters in DB2*/
>+	/* Some identifiers like Constraint name, Cursor name, Function name, Index name, Trigger name, Column name, Schema name, Savepoint names, Table names, view names etc are limited to 128 characters in DB2*/
> 	public static final int DB2_MAX_IDENTIFIER_LENGTH128 = 128;
> 	public static final int	DB2_CHAR_MAXWIDTH = 254;
> 	public static final int	DB2_VARCHAR_MAXWIDTH = 32672;
>  
>

Re: [PATCH] Change all Identifier Limitations to 128

Posted by Jeffrey Lichtman <sw...@rcn.com>.
>this patch changes maximum length of column names, index/contraint names, 
>cursor names and schema names to 128 and keeps MaxUserNameLength at 30.
>it also fixes the metadata to return correct values

Does this introduce an upgrade issue? It seems to me the column lengths for 
these identifiers in the system tables need to change.


                        -        Jeff Lichtman
                                 swazoo@rcn.com
                                 Check out Swazoo Koolak's Web Jukebox at
                                 http://swazoo.com/ 


Re: [PATCH] Change all Identifier Limitations to 128

Posted by Daniel John Debrunner <dj...@debrunners.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Daniel John Debrunner wrote:

> Philipp Hug wrote:
>
>
>>this patch changes maximum length of column names, index/contraint
>>names, cursor names and schema names to 128 and keeps MaxUserNameLength
>>at 30.
>>it also fixes the metadata to return correct values
>
>
> A couple of the tests fail with this patch, looks like they are just a
> result of the limit changing, rather than anything wrong.


This patch hasn't been applied yet. I think it's been held up because
as-is it causes the functional tests to "fail".

I think maybe the committers need to add some information on the site
about how to commit patches and items the contributor can do to increase
the chance and pace of acceptance.

With cases like this where the test "failures" are due to correct change
of behaviour, who should be updating the test output? Speaking for
myself as a committer, I don't have time to clean up test failures for
patches. Maybe once in a while, but not on a regular basis.

Dan.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFCAm4UIv0S4qsbfuQRAhv4AJoDgYdhxUmvRNuNViyQ/CyTqYueeACg5I41
fOqZMFGP70Ti3HzLwnYSqjM=
=NyWl
-----END PGP SIGNATURE-----


Re: [PATCH] Change all Identifier Limitations to 128

Posted by Daniel John Debrunner <dj...@debrunners.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Philipp Hug wrote:

> this patch changes maximum length of column names, index/contraint
> names, cursor names and schema names to 128 and keeps MaxUserNameLength
> at 30.
> it also fixes the metadata to return correct values

A couple of the tests fail with this patch, looks like they are just a
result of the limit changing, rather than anything wrong.

Dan.

********* Diff file derbyall/derbylang/metadata.diff
*** Start: metadata jdk1.4.2 derbyall:derbylang 2004-12-17 10:12:59 ***
15 del
< maxColumnNameLength(): 30
15a15
> maxColumnNameLength(): 128
134 del
< getMaxCursorNameLength(): 18
134a134
> getMaxCursorNameLength(): 128
136 del
< getMaxSchemaNameLength(): 30
136a136
> getMaxSchemaNameLength(): 128
Test Failed.
*** End:   metadata jdk1.4.2 derbyall:derbylang 2004-12-17 10:13:29 ***
********* Diff file derbyall/derbylang/currentSchema.diff
*** Start: currentSchema jdk1.4.2 derbyall:derbylang 2004-12-17 10:24:32 ***
310,320d309
< ERROR 42622: The name 'T234567890123456789012345678901' is too long.
The maximum length is '30'.
< ij> set schema t234567890123456789012345678901;
< ERROR 42622: The name 'T234567890123456789012345678901' is too long.
The maximum length is '30'.
< ij> set schema 'T234567890123456789012345678901';
< ERROR 42622: The name 'T234567890123456789012345678901' is too long.
The maximum length is '30'.
< ij> execute p1 using 'values(''T234567890123456789012345678901'')';
< ERROR 42Y07: Schema 'T234567890123456789012345678901' does not exist
< ij> rollback;
< ij> autocommit on;
< ij> -- clean up
< drop schema judy restrict;
321a311,321
> ij> set schema t234567890123456789012345678901;
> 0 rows inserted/updated/deleted
> ij> set schema 'T234567890123456789012345678901';
> 0 rows inserted/updated/deleted
> ij> execute p1 using 'values(''T234567890123456789012345678901'')';
> 0 rows inserted/updated/deleted
> ij> rollback;
> ij> autocommit on;
> ij> -- clean up
> drop schema judy restrict;
> 0 rows inserted/updated/deleted
323 del
< ERROR 42622: The name 'T234567890123456789012345678901' is too long.
The maximum length is '30'.
323a323
> ERROR 42Y07: Schema 'T234567890123456789012345678901' does not exist
Test Failed.
*** End:   currentSchema jdk1.4.2 derbyall:derbylang 2004-12-17 10:24:45 ***
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBwzReIv0S4qsbfuQRAvXQAJoDiAjCSAVlmdvbY3NSORPxy+W2FQCfS8z0
P6S+lQLNPu+S+l85pss2vrQ=
=Hok8
-----END PGP SIGNATURE-----


Re: [PATCH] Change all Identifier Limitations to 128

Posted by Daniel John Debrunner <dj...@debrunners.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jack Klebanoff wrote:

> Daniel John Debrunner wrote:
>
>> Philipp Hug wrote:
>>
>> >this patch changes maximum length of column names, index/contraint
>> >names, cursor names and schema names to 128 and keeps MaxUserNameLength
>> >at 30.
>> >it also fixes the metadata to return correct values
>>
>>
>> it also fails to compile :-(

Sorry, mea culpa, applied the patch to the wrong codeline.

Patch compiles fine.

Note to self:
   New Year's Resolution - reduce number of codelines on machine!

Dan.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD4DBQFBwxrpIv0S4qsbfuQRAvKuAJ9E+gcG0uNXCV6yOcEqhgMOGd4tDgCXWgJV
ijhAxHErp8ZGMSKB611Ggw==
=ap91
-----END PGP SIGNATURE-----


Re: [PATCH] Change all Identifier Limitations to 128

Posted by Jack Klebanoff <kl...@Mutagen.Net>.
Daniel John Debrunner wrote:

> Philipp Hug wrote:
>
> >this patch changes maximum length of column names, index/contraint
> >names, cursor names and schema names to 128 and keeps MaxUserNameLength
> >at 30.
> >it also fixes the metadata to return correct values
>
>
> it also fails to compile :-(
>
> Any contributor should check that their patch compiles after an
>   ant clobber
>
> (see BUILDING.txt for details).
>
>     [javac] Found 2 semantic errors compiling
> "C:/work/p4/os/cqc/java/com/ibm/cq
> c/language/SQLParser.java":
>     [javac]  15828.         schemaName =
> identifier(DB2Limit.DB2_MAX_IDENTIFIER_
> LENGTH30, true);
>     [javac]
>
Dan, com/ibm/cqc is not part of Derby.

Jack

Re: [PATCH] Change all Identifier Limitations to 128

Posted by Daniel John Debrunner <dj...@debrunners.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Philipp Hug wrote:

> this patch changes maximum length of column names, index/contraint
> names, cursor names and schema names to 128 and keeps MaxUserNameLength
> at 30.
> it also fixes the metadata to return correct values

it also fails to compile :-(

Any contributor should check that their patch compiles after an
  ant clobber

(see BUILDING.txt for details).

    [javac] Found 2 semantic errors compiling
"C:/work/p4/os/cqc/java/com/ibm/cq
c/language/SQLParser.java":
    [javac]  15828.         schemaName =
identifier(DB2Limit.DB2_MAX_IDENTIFIER_
LENGTH30, true);
    [javac]
<---------------------------
- ------->
    [javac] *** Error: No field named "DB2_MAX_IDENTIFIER_LENGTH30" was
found in
 type "org/apache/derby/iapi/reference/DB2Limit". However, there is an
accessibl
e field "DB2_MAX_IDENTIFIER_LENGTH128" whose name closely matches the
name "DB2_
MAX_IDENTIFIER_LENGTH30".
    [javac]  15849.         schemaName =
identifier(DB2Limit.DB2_MAX_IDENTIFIER_
LENGTH30, true);
    [javac]
<---------------------------
- ------->
    [javac] *** Error: No field named "DB2_MAX_IDENTIFIER_LENGTH30" was
found in
 type "org/apache/derby/iapi/reference/DB2Limit". However, there is an
accessibl
e field "DB2_MAX_IDENTIFIER_LENGTH128" whose name closely matches the
name "DB2_
MAX_IDENTIFIER_LENGTH30".
    [javac] Compile failed; see the compiler error output for details.

Dan.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBwwYyIv0S4qsbfuQRAl9IAKCPlmi4H3JdzIJcxXcWRqYFJTD+agCg4Eln
tTHmQ82hDAtyGz27VgblBiY=
=ZVMR
-----END PGP SIGNATURE-----


Re: [PATCH] Change all Identifier Limitations to 128

Posted by Kathey Marsden <km...@Sourcery.Org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Philipp Hug wrote:

> this patch changes maximum length of column names, index/contraint
> names, cursor names and schema names to 128 and keeps MaxUserNameLength
> at 30.
> it also fixes the metadata to return correct values


I have a few questions about this change.

1)  For a change like this I would think there would be some functional
tests needed and of course documentation changes.   So how do they come
to be?  It would be good to have the  functional tests go in with the
change  and have someone at least signed up to do the doc changes.
Otherwise how do we keep track?

2) What are the implications of this change on soft upgrade?

3)If we change the limits what do we do about this line in our charter?

"And it also means developers can later migrate to other databases if
they so choose."

Is it still appropriate?



Thanks

Kathey


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBwdmSG0h36bFmkocRAmceAJ95p/QfuYz3UljEnlLZchCMZR0NywCeOmJ+
ozDu/NRK162zg7Ut+LzoXSo=
=2AhR
-----END PGP SIGNATURE-----

[PATCH] Change all Identifier Limitations to 128

Posted by Philipp Hug <ph...@hug.cx>.
this patch changes maximum length of column names, index/contraint 
names, cursor names and schema names to 128 and keeps MaxUserNameLength 
at 30.
it also fixes the metadata to return correct values

philipp
Philipp Hug wrote:

> I know this has been discussed before, but there hasn't been a consus 
> if those limitations should be extended...
> At the moment, I patched Derby to allow longer identifier for 
> index/constraint names, because the CMP engine I'm using, uses 
> getMaxColumnNameLength() as limitation for index name.
> Does anyone know of any metadata attribute that would specify the 
> maximum allowed length for an index/constraint name? If there is such 
> an attribute, I could live with that and would just fix the CMP 
> engine? Otherwise we should really think about extending it to a 
> decent value (e.g. 30 or 128).
>
> btw: cloudscape 9 didn't have this limitation, it has been added in 
> cloudscape 10/derby
>
> greets
> philipp
>