mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Bugfix: fix issue #333.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
{
|
||||
String selection = ((Combo)source.get("dbs")).getText();
|
||||
DB db = context.get("db");
|
||||
DB.Result result = db.execute("show tables from " + selection);
|
||||
DB.Result result = db.execute("show tables from `" + selection + "`");
|
||||
|
||||
ListBoxUtils.populate(tables, result, 0);
|
||||
}
|
||||
@@ -130,7 +130,7 @@
|
||||
String version = db.execute("select version()").first().get("version()");
|
||||
String compileOS = db.execute("show variables like 'version_compile_os'").first().get("value");
|
||||
String characterSet = db.execute("show variables like 'character_set_connection'").first().get("value");
|
||||
String dbCreate = db.execute("show create database " + selection).first().get("create database");
|
||||
String dbCreate = db.execute("show create database `" + selection + "`").first().get("create database");
|
||||
String tableCreate = "";
|
||||
|
||||
buffer.append("# jHeidi Dump").append(lineSep)
|
||||
@@ -166,7 +166,7 @@
|
||||
{
|
||||
for ( String table : (List<String>) tableList )
|
||||
{
|
||||
DB.Result createTable = db.execute("show create table " + table);
|
||||
DB.Result createTable = db.execute("show create table `" + table + "`");
|
||||
tableCreate = createTable.first().get("create table");
|
||||
|
||||
buffer.append("#").append(lineSep)
|
||||
@@ -186,8 +186,8 @@
|
||||
|
||||
if ( !"Don't create".equals(dataOption) )
|
||||
{
|
||||
DB.Result tableValues = db.execute("select * from " + table);
|
||||
DB.Result showFields = db.execute("show fields from " + table);
|
||||
DB.Result tableValues = db.execute("select * from `" + table + "`");
|
||||
DB.Result showFields = db.execute("show fields from `" + table + "`");
|
||||
|
||||
buffer.append("#").append(lineSep)
|
||||
.append("# Dumping data for table '").append(table).append("'").append(lineSep)
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
DB db = context.get("db");
|
||||
db.begin();
|
||||
db.execute("use " + (String)context.get("currentDB"));
|
||||
DB.Result result = db.execute("show full columns from " + (String) context.get("currentTable"));
|
||||
DB.Result result = db.execute("show full columns from `" + (String) context.get("currentTable") + "`");
|
||||
db.end();
|
||||
|
||||
Combo positions = context.get("/positions");
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
String selection = ((Combo)dlg.get("dbs")).getText();
|
||||
DB db = context.get("db");
|
||||
DB.Result tables = db.execute("show tables from " + selection);
|
||||
DB.Result tables = db.execute("show tables from `" + selection + "`");
|
||||
|
||||
Combo combo = dlg.get("tables");
|
||||
ComboUtils.populate(combo, tables, 0);
|
||||
@@ -162,8 +162,8 @@
|
||||
String selection = ((Combo)context.get("/tables")).getText();
|
||||
String dbsel = ((Combo)context.get("/dbs")).getText();
|
||||
DB db = context.get("db");
|
||||
DB.Result otherFields = db.execute("show columns from " + dbsel + "." + selection + " where type not like '%blob'");
|
||||
DB.Result blobFields = db.execute("show columns from " + dbsel + "." + selection + " where type like '%blob'");
|
||||
DB.Result otherFields = db.execute("show columns from `" + dbsel + "`.`" + selection + "` where type not like '%blob'");
|
||||
DB.Result blobFields = db.execute("show columns from `" + dbsel + "`.`" + selection + "` where type like '%blob'");
|
||||
|
||||
Combo combo = dlg.get("blobColumns");
|
||||
if (!blobFields.isEmpty())
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
|
||||
String selection = ((Combo)dest.get("dbs")).getText();
|
||||
DB db = context.get("db");
|
||||
DB.Result tables = db.execute("show tables from " + selection);
|
||||
DB.Result tables = db.execute("show tables from `" + selection + "`");
|
||||
|
||||
Combo combo = dest.get("tables");
|
||||
ComboUtils.populate(combo, tables, 0);
|
||||
@@ -164,7 +164,7 @@
|
||||
String selection = ((Combo)context.get("/tabs/Destination/tables")).getText();
|
||||
String dbsel = ((Combo)context.get("/tabs/Destination/dbs")).getText();
|
||||
DB db = context.get("db");
|
||||
DB.Result fields = db.execute("show columns from " + dbsel + "." + selection);
|
||||
DB.Result fields = db.execute("show columns from `" + dbsel + "`.`" + selection + "`");
|
||||
|
||||
ListBox listbox = dest.get("fields");
|
||||
ListBoxUtils.populate(listbox, fields, 0);
|
||||
|
||||
@@ -56,8 +56,8 @@
|
||||
DB db = context.get("db");
|
||||
db.begin();
|
||||
db.execute("use " + (String)context.get("currentDB"));
|
||||
DB.Result result = db.execute("show keys from " + (String) context.get("currentTable"));
|
||||
DB.Result allColumns = db.execute("show columns from " + context.get("currentTable"));
|
||||
DB.Result result = db.execute("show keys from `" + (String) context.get("currentTable") + "`");
|
||||
DB.Result allColumns = db.execute("show columns from `" + context.get("currentTable") + "`");
|
||||
db.end();
|
||||
|
||||
Combo indexes = context.get("/indexes");
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
for ( HashObject _dbs : databases )
|
||||
{
|
||||
String dbName = (String) _dbs.get(0);
|
||||
DB.Result tables = db.execute("show tables from " + dbName);
|
||||
DB.Result tables = db.execute("show tables from `" + dbName + "`");
|
||||
log.debug("adding tables to node (" + dbName + ") " + dbNodes.getObject(dbName));
|
||||
TreeUtils.populateList((NodeInfo)dbNodes.getObject(dbName), tables, 0, "table");
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
DB db = context.get("db");
|
||||
db.begin();
|
||||
db.execute("use mysql");
|
||||
DB.Result users = db.execute("select * from user order by user, host");
|
||||
DB.Result users = db.execute("select * from `user` order by user, host");
|
||||
db.end();
|
||||
|
||||
List userList = new ArrayList(users.size());
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
WindowContext context = argObj("windowContext");
|
||||
|
||||
DB db = context.get("db");
|
||||
DB.Result databases = db.execute("show table status from " + arg("dbName"));
|
||||
DB.Result databases = db.execute("show table status from `" + arg("dbName") + "`");
|
||||
|
||||
Text banner = context.get("/mainTabs/Database/toolbar/banner");
|
||||
banner.setText("Database " + arg("dbName") + ": " + databases.size() + " table(s)");
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
Table table = context.get("/mainTabs/Data/table");
|
||||
|
||||
db.begin();
|
||||
db.execute("use " + arg("dbName"));
|
||||
DB.Result count = db.query("select count(*) from " + arg("tableName"));
|
||||
DB.Result data = db.query("select * from " + arg("tableName") + " limit 50");
|
||||
db.execute("use `" + arg("dbName") + "`");
|
||||
DB.Result count = db.query("select count(*) from `" + arg("tableName") + "`");
|
||||
DB.Result data = db.query("select * from `" + arg("tableName") + "` limit 50");
|
||||
db.end();
|
||||
|
||||
Text banner = context.get("/mainTabs/Data/toolbar/banner");
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
DB db = context.get("db");
|
||||
|
||||
db.begin();
|
||||
db.execute("use " + arg("dbName"));
|
||||
DB.Result tables = db.execute("show full columns from " + arg("tableName"));
|
||||
db.execute("use `" + arg("dbName") + "`");
|
||||
DB.Result tables = db.execute("show full columns from `" + arg("tableName") + "`");
|
||||
db.end();
|
||||
|
||||
Text banner = context.get("/mainTabs/Table/toolbar/banner");
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{
|
||||
String selection = ((Combo)context.get("/dbs")).getText();
|
||||
DB db = context.get("db");
|
||||
DB.Result result = db.execute("show tables from " + selection);
|
||||
DB.Result result = db.execute("show tables from `" + selection + "`");
|
||||
|
||||
ListBoxUtils.populate(tables, result, 0);
|
||||
}
|
||||
@@ -31,7 +31,7 @@
|
||||
String sep="";
|
||||
for (Object o: values)
|
||||
{
|
||||
sql+=sep+(String)o;
|
||||
sql+=sep+"`"+(String)o+"`";
|
||||
sep=",";
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@
|
||||
String sep="";
|
||||
for (Object o: values)
|
||||
{
|
||||
sql+=sep+(String)o;
|
||||
sql+=sep+"`"+(String)o+"`";
|
||||
sep=",";
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,7 @@
|
||||
String sep="";
|
||||
for (Object o: values)
|
||||
{
|
||||
sql+=sep+(String)o;
|
||||
sql+=sep+"`"+(String)o+"`";
|
||||
sep=",";
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@
|
||||
String sep="";
|
||||
for (Object o: values)
|
||||
{
|
||||
sql+=sep+(String)o;
|
||||
sql+=sep+"`"+(String)o+"`";
|
||||
sep=",";
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@
|
||||
{
|
||||
DB db = context.get("db");
|
||||
db.begin();
|
||||
db.execute("use " + ((Combo)context.get("/dbs")).getText());
|
||||
db.execute("use `" + ((Combo)context.get("/dbs")).getText() + "`");
|
||||
DB.Result result = db.execute(sql);
|
||||
db.end();
|
||||
TableUtils.populate((Table)context.get("/results"), result);
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
|
||||
DB db = context.get("db");
|
||||
DB.Result result = db.execute("show columns from mysql.user where field like '%_priv'");
|
||||
DB.Result result = db.execute("show columns from `mysql`.`user` where field like '%_priv'");
|
||||
String[] privList = new String[result.size()];
|
||||
int[] selections = new int[8];
|
||||
int c = 0;
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
ListBox privs = editTab.get("privs");
|
||||
|
||||
DB db = context.get("db");
|
||||
DB.Result result = db.execute("select * from mysql.user where user='" + userHost[0] + "' and host='" + userHost[1] + "'");
|
||||
DB.Result result = db.execute("select * from `mysql`.`user` where user='" + userHost[0] + "' and host='" + userHost[1] + "'");
|
||||
HashObject user = result.first();
|
||||
|
||||
int c = 0;
|
||||
|
||||
Reference in New Issue
Block a user