Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-06-25 09:22:39 +0000
committerEike Stepper2008-06-25 09:22:39 +0000
commite5db6cc0930d03a477d977d9b534d01ae9e28759 (patch)
treeb8f900061ae8af1b7631d03c02400ad3f41d0821 /plugins/org.eclipse.net4j.db
parent65993008ed3258ffc8d8da6773e920d96b5c95b5 (diff)
downloadcdo-e5db6cc0930d03a477d977d9b534d01ae9e28759.tar.gz
cdo-e5db6cc0930d03a477d977d9b534d01ae9e28759.tar.xz
cdo-e5db6cc0930d03a477d977d9b534d01ae9e28759.zip
[225125] [DB] Quotes are not escaped (enough)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=225125
Diffstat (limited to 'plugins/org.eclipse.net4j.db')
-rw-r--r--plugins/org.eclipse.net4j.db/.settings/.api_filters69
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBType.java5
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/spi/db/DBSchema.java5
3 files changed, 75 insertions, 4 deletions
diff --git a/plugins/org.eclipse.net4j.db/.settings/.api_filters b/plugins/org.eclipse.net4j.db/.settings/.api_filters
new file mode 100644
index 0000000000..c9e9bbbff0
--- /dev/null
+++ b/plugins/org.eclipse.net4j.db/.settings/.api_filters
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.net4j.db" version="2">
+ <resource path="src/org/eclipse/net4j/spi/db/DBSchema.java" type="org.eclipse.net4j.spi.db.DBSchema">
+ <filter id="643842064">
+ <message_arguments>
+ <message_argument value="DBTable"/>
+ <message_argument value="DBSchema"/>
+ <message_argument value="addTable(String)"/>
+ </message_arguments>
+ </filter>
+ <filter id="643842064">
+ <message_arguments>
+ <message_argument value="DBTable"/>
+ <message_argument value="DBSchema"/>
+ <message_argument value="getTables()"/>
+ </message_arguments>
+ </filter>
+ <filter id="643842064">
+ <message_arguments>
+ <message_argument value="DBTable"/>
+ <message_argument value="DBSchema"/>
+ <message_argument value="getTable(String)"/>
+ </message_arguments>
+ </filter>
+ <filter id="576720909">
+ <message_arguments>
+ <message_argument value="DBSchemaElement"/>
+ <message_argument value="DBSchema"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/net4j/spi/db/DBAdapter.java" type="org.eclipse.net4j.spi.db.DBAdapter">
+ <filter id="643846161">
+ <message_arguments>
+ <message_argument value="DBIndex"/>
+ <message_argument value="DBAdapter"/>
+ <message_argument value="createIndex(DBIndex, Statement, int)"/>
+ </message_arguments>
+ </filter>
+ <filter id="643846161">
+ <message_arguments>
+ <message_argument value="DBField"/>
+ <message_argument value="DBAdapter"/>
+ <message_argument value="createFieldDefinition(DBField)"/>
+ </message_arguments>
+ </filter>
+ <filter id="643846161">
+ <message_arguments>
+ <message_argument value="DBTable"/>
+ <message_argument value="DBAdapter"/>
+ <message_argument value="doCreateTable(DBTable, Statement)"/>
+ </message_arguments>
+ </filter>
+ <filter id="643846161">
+ <message_arguments>
+ <message_argument value="DBTable"/>
+ <message_argument value="DBAdapter"/>
+ <message_argument value="createConstraints(DBTable)"/>
+ </message_arguments>
+ </filter>
+ <filter id="643846161">
+ <message_arguments>
+ <message_argument value="DBTable"/>
+ <message_argument value="DBAdapter"/>
+ <message_argument value="validateTable(DBTable, Statement)"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBType.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBType.java
index a2ac905b02..730dffc8b4 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBType.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBType.java
@@ -121,12 +121,9 @@ public enum DBType
for (int i = 0; i < str.length(); i++)
{
char c = str.charAt(i);
+ builder.append(c);
if (c == '\'')
{
- builder.append("\\'");
- }
- else
- {
builder.append(c);
}
}
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/spi/db/DBSchema.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/spi/db/DBSchema.java
index 23ccc266d4..2ff35c29ab 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/spi/db/DBSchema.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/spi/db/DBSchema.java
@@ -118,6 +118,11 @@ public class DBSchema extends DBSchemaElement implements IDBSchema
try
{
connection = connectionProvider.getConnection();
+ if (connection == null)
+ {
+ throw new DBException("No connection available from " + connectionProvider);
+ }
+
return create(dbAdapter, connection);
}
finally

Back to the top