Commit 76fe97d9 authored by Giant's avatar Giant
Browse files

Don't use "AS" if select "*"...

parent 990e1547
......@@ -197,9 +197,13 @@ public class H2SelectQuery implements SelectQuery {
++i;
}
sB.append(entry.getKey().replace("#__", this.db.getPrefix()));
sB.append(" AS ");
sB.append(entry.getValue().replace("#__", this.db.getPrefix()));
if(!entry.getKey().equals("*")) {
sB.append(entry.getKey().replace("#__", this.db.getPrefix()));
sB.append(" AS ");
sB.append(entry.getValue().replace("#__", this.db.getPrefix()));
}else{
sB.append(entry.getKey());
}
}
sB.append("\n");
......
......@@ -193,17 +193,20 @@ public class MySQLSelectQuery implements SelectQuery {
sB.append("SELECT ");
if(this.s.size() > 0) {
int i = 0;
for(Map.Entry<String, String> field : this.s.entrySet()) {
for(Map.Entry<String, String> entry : this.s.entrySet()) {
if(i > 0) {
sB.append(", ");
}else{
++i;
}
sB.append(field.getKey().replace("#__", this.db.getPrefix()));
sB.append(" AS ");
sB.append(field.getValue().replace("#__", this.db.getPrefix()));
i++;
if(!entry.getKey().equals("*")) {
sB.append(entry.getKey().replace("#__", this.db.getPrefix()));
sB.append(" AS ");
sB.append(entry.getValue().replace("#__", this.db.getPrefix()));
}else{
sB.append(entry.getKey());
}
}
}else{
......
......@@ -197,9 +197,13 @@ public class SQLiteSelectQuery implements SelectQuery {
++i;
}
sB.append(entry.getKey().replace("#__", this.db.getPrefix()));
sB.append(" AS ");
sB.append(entry.getValue().replace("#__", this.db.getPrefix()));
if(!entry.getKey().equals("*")) {
sB.append(entry.getKey().replace("#__", this.db.getPrefix()));
sB.append(" AS ");
sB.append(entry.getValue().replace("#__", this.db.getPrefix()));
}else{
sB.append(entry.getKey());
}
}
sB.append("\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment