Browse Source

Don't double quote already quoted identifiers. fixes patch 18

git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@901 f203690c-595d-4dc9-a70b-905162fa7fd2
tags/jackcess-2.0.8
James Ahlborn 9 years ago
parent
commit
e6e0208c97

+ 6
- 0
pom.xml View File

<role>Contributed to cookbook.</role> <role>Contributed to cookbook.</role>
</roles> </roles>
</contributor> </contributor>
<contributor>
<name>Gabriele Favalessa</name>
<roles>
<role>Fixed various query generation issues.</role>
</roles>
</contributor>
</contributors> </contributors>
<issueManagement> <issueManagement>
<system>SourceForge2</system> <system>SourceForge2</system>

+ 3
- 0
src/changes/changes.xml View File

<action dev="jahlborn" type="fix" system="SourceForge2Patches" issue="17"> <action dev="jahlborn" type="fix" system="SourceForge2Patches" issue="17">
Fix table name quoting for append and make table queries. Fix table name quoting for append and make table queries.
</action> </action>
<action dev="jahlborn" type="fix" system="SourceForge2Patches" issue="18">
Don't double quote already quoted identifiers.
</action>
</release> </release>
<release version="2.0.7" date="2014-11-22"> <release version="2.0.7" date="2014-11-22">
<action dev="jahlborn" type="fix" system="SourceForge2" issue="111"> <action dev="jahlborn" type="fix" system="SourceForge2" issue="111">

+ 8
- 1
src/main/java/com/healthmarketscience/jackcess/impl/query/QueryImpl.java View File

protected static StringBuilder toQuotedExpr(StringBuilder builder, protected static StringBuilder toQuotedExpr(StringBuilder builder,
String expr) String expr)
{ {
return builder.append('[').append(expr).append(']');
return (!isQuoted(expr) ?
builder.append('[').append(expr).append(']') :
builder.append(expr));
}

protected static boolean isQuoted(String expr) {
return ((expr.length() >= 2) &&
(expr.charAt(0) == '[') && (expr.charAt(expr.length() - 1) == ']'));
} }


protected static StringBuilder toRemoteDb(StringBuilder builder, protected static StringBuilder toRemoteDb(StringBuilder builder,

+ 1
- 1
src/test/java/com/healthmarketscience/jackcess/query/QueryTest.java View File

"UpdateQuery",multiline( "UpdateQuery",multiline(
"PARAMETERS User Name Text;", "PARAMETERS User Name Text;",
"UPDATE Table1", "UPDATE Table1",
"SET Table1.col1 = \"foo\", Table1.col2 = [Table2].[col3], [[Table2]].[[col1]] = [User Name]",
"SET Table1.col1 = \"foo\", Table1.col2 = [Table2].[col3], [Table2].[col1] = [User Name]",
"WHERE ((([Table2].[col1]) Is Not Null));")); "WHERE ((([Table2].[col1]) Is Not Null));"));
expectedQueries.put( expectedQueries.put(
"MakeTableQuery",multiline( "MakeTableQuery",multiline(

Loading…
Cancel
Save