You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2007/10/27 00:53:59 UTC
svn commit: r588788 - in /db/derby/code/trunk/java/engine/org/apache/derby:
iapi/services/property/ iapi/sql/conn/ iapi/util/ impl/sql/compile/
impl/sql/conn/ impl/sql/execute/
Author: djd
Date: Fri Oct 26 15:53:58 2007
New Revision: 588788
URL: http://svn.apache.org/viewvc?rev=588788&view=rev
Log:
DERBY-3147 (partial) Remove unused code to support lower-case regular identifiers from the language connection context code and the parser.
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/property/PropertyUtil.java
db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/StringUtil.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/property/PropertyUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/property/PropertyUtil.java?rev=588788&r1=588787&r2=588788&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/property/PropertyUtil.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/property/PropertyUtil.java Fri Oct 26 15:53:58 2007
@@ -459,9 +459,10 @@
return defaultValue;
String vS = ((String) v).trim();
- if (StringUtil.SQLToLowerCase(vS).equals("true"))
+
+ if ("TRUE".equals(StringUtil.SQLToUpperCase(vS)))
return true;
- if (StringUtil.SQLToLowerCase(vS).equals("false"))
+ if ("FALSE".equals(StringUtil.SQLToUpperCase(vS)))
return false;
throw StandardException.newException(SQLState.PROPERTY_INVALID_VALUE, p,vS);
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java?rev=588788&r1=588787&r2=588788&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java Fri Oct 26 15:53:58 2007
@@ -904,27 +904,6 @@
*/
public boolean isTransactionPristine();
- /**
- * Get casing for delimited identifiers. This feature is here to
- * support the Plugin.
- *
- * @return ANSI_CASING or ANTI_ANSI_CASING.
- *
- * @exception StandardException thrown if something goes wrong
- */
- public int getIdentifierCasing() throws StandardException;
-
- /**
- * Convert an identifier to the proper case for this connection. This method
- * is here to support the Plugin.
- *
- * @param id an identifier string
- * @return the string converted to upper or lower case, as appropriate
- *
- * @exception StandardException thrown if something goes wrong
- */
- public String convertIdentifierCase( String id) throws StandardException;
-
/**
* Returns the last autoincrement value inserted by this connection.
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/StringUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/StringUtil.java?rev=588788&r1=588787&r2=588788&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/StringUtil.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/StringUtil.java Fri Oct 26 15:53:58 2007
@@ -372,7 +372,7 @@
if (s2 == null)
return false;
else
- return s1.toUpperCase(Locale.ENGLISH).equals(s2.toUpperCase(Locale.ENGLISH));
+ return SQLToUpperCase(s1).equals(SQLToUpperCase(s2));
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj?rev=588788&r1=588787&r2=588788&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj Fri Oct 26 15:53:58 2007
@@ -13090,7 +13090,7 @@
* <A NAME="identifier">identifier</A>
*/
String
-internalIdentifier( int id_length_limit, boolean useANSICasing, boolean checkLength) throws StandardException :
+internalIdentifier( int id_length_limit, boolean checkLength) throws StandardException :
{
String str;
Token tok;
@@ -13098,11 +13098,9 @@
{
tok = <IDENTIFIER>
{
- if( useANSICasing)
- str = StringUtil.SQLToUpperCase(tok.image);
- else
- str = getLanguageConnectionContext().convertIdentifierCase( tok.image);
- if (checkLength) {//if checkLength false, then calling method would do the length limit checks
+ str = StringUtil.SQLToUpperCase(tok.image);
+
+ if (checkLength) {//if checkLength false, then calling method would do the length limit checks
//limit the identifier to the id length limit passed to this method
checkIdentifierLengthLimit(str, id_length_limit);
}
@@ -13125,7 +13123,7 @@
|
str = nonReservedKeyword()
{
- return getLanguageConnectionContext().convertIdentifierCase( str);
+ return StringUtil.SQLToUpperCase(str);
}
}
@@ -13135,7 +13133,7 @@
String id;
}
{
- id = internalIdentifier( id_length_limit, false, checkLength)
+ id = internalIdentifier( id_length_limit, checkLength)
{
return id;
}
@@ -13622,7 +13620,7 @@
|
str = reservedKeyword()
{
- return getLanguageConnectionContext().convertIdentifierCase( str);
+ return StringUtil.SQLToUpperCase(str);
}
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java?rev=588788&r1=588787&r2=588788&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java Fri Oct 26 15:53:58 2007
@@ -135,8 +135,6 @@
private final int instanceNumber;
private String drdaID;
private String dbname;
-
- private int identifierCasing = UNKNOWN_CASING;
/**
The transaction to use within this language connection context. It may
@@ -2603,39 +2601,6 @@
return getTransactionExecute().isPristine();
}
- /**
- * Convert an identifier to the proper case for this connection. This method
- * is here to support the Plugin.
- *
- * @param id an identifier string
- * @return the string converted to upper or lower case, as appropriate
- *
- * @exception StandardException thrown if something goes wrong
- */
- public String convertIdentifierCase( String id) throws StandardException
- {
- if( ANTI_ANSI_CASING == getIdentifierCasing())
- return StringUtil.SQLToLowerCase(id);
- else
- return StringUtil.SQLToUpperCase(id);
- }
-
- /**
- * Get casing for delimited identifiers. This feature is here to
- * support the Plugin.
- *
- * @return ANSI_CASING or ANTI_ANSI_CASING.
- *
- * @exception StandardException thrown if something goes wrong
- */
- public int getIdentifierCasing() throws StandardException
- {
- if( UNKNOWN_CASING == identifierCasing)
- {
- identifierCasing = ANSI_CASING;
- }
- return identifierCasing;
- }
//
// Context interface
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java?rev=588788&r1=588787&r2=588788&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java Fri Oct 26 15:53:58 2007
@@ -181,8 +181,7 @@
String dbcp_s = PropertyUtil.getServiceProperty(lcc.getTransactionExecute(),Property.DATABASE_CLASSPATH);
if (dbcp_s != null)
{
- String[][]dbcp= IdUtil.parseDbClassPath(dbcp_s,
- lcc.getIdentifierCasing() != lcc.ANTI_ANSI_CASING );
+ String[][]dbcp= IdUtil.parseDbClassPath(dbcp_s, true);
boolean found = false;
//
//Look for the jar we are dropping on our database classpath.