diff --git a/extra/jheidi/exportDDLEvents.ajl b/extra/jheidi/exportDDLEvents.ajl index 98c95f2a..08e797f2 100644 --- a/extra/jheidi/exportDDLEvents.ajl +++ b/extra/jheidi/exportDDLEvents.ajl @@ -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) 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) diff --git a/extra/jheidi/fieldDialog.ajl b/extra/jheidi/fieldDialog.ajl index b9f6fd1f..4dea8738 100755 --- a/extra/jheidi/fieldDialog.ajl +++ b/extra/jheidi/fieldDialog.ajl @@ -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"); diff --git a/extra/jheidi/filesToBlobsEvents.ajl b/extra/jheidi/filesToBlobsEvents.ajl index 59bbbcab..f05c96e3 100755 --- a/extra/jheidi/filesToBlobsEvents.ajl +++ b/extra/jheidi/filesToBlobsEvents.ajl @@ -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()) diff --git a/extra/jheidi/importCSVEvents.ajl b/extra/jheidi/importCSVEvents.ajl index 8f8a0e1f..a56466c6 100644 --- a/extra/jheidi/importCSVEvents.ajl +++ b/extra/jheidi/importCSVEvents.ajl @@ -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); diff --git a/extra/jheidi/indexDialog.ajl b/extra/jheidi/indexDialog.ajl index a7c50304..34f7a9c3 100755 --- a/extra/jheidi/indexDialog.ajl +++ b/extra/jheidi/indexDialog.ajl @@ -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"); diff --git a/extra/jheidi/initTree.ajl b/extra/jheidi/initTree.ajl index 60515a22..7cbc4476 100644 --- a/extra/jheidi/initTree.ajl +++ b/extra/jheidi/initTree.ajl @@ -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"); } diff --git a/extra/jheidi/initUserTree.ajl b/extra/jheidi/initUserTree.ajl index 1417232b..795419a7 100755 --- a/extra/jheidi/initUserTree.ajl +++ b/extra/jheidi/initUserTree.ajl @@ -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()); diff --git a/extra/jheidi/loadDatabaseInfo.ajl b/extra/jheidi/loadDatabaseInfo.ajl index 4788ad18..ce21cc0c 100644 --- a/extra/jheidi/loadDatabaseInfo.ajl +++ b/extra/jheidi/loadDatabaseInfo.ajl @@ -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)"); diff --git a/extra/jheidi/loadTableData.ajl b/extra/jheidi/loadTableData.ajl index 7bfba85f..4a9deec6 100644 --- a/extra/jheidi/loadTableData.ajl +++ b/extra/jheidi/loadTableData.ajl @@ -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"); diff --git a/extra/jheidi/loadTableInfo.ajl b/extra/jheidi/loadTableInfo.ajl index dc8b4c7f..0852d71c 100644 --- a/extra/jheidi/loadTableInfo.ajl +++ b/extra/jheidi/loadTableInfo.ajl @@ -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"); diff --git a/extra/jheidi/maintenanceDialogEvents.ajl b/extra/jheidi/maintenanceDialogEvents.ajl index 215c7a94..3c98ce13 100644 --- a/extra/jheidi/maintenanceDialogEvents.ajl +++ b/extra/jheidi/maintenanceDialogEvents.ajl @@ -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); diff --git a/extra/jheidi/userManagerDialog.ajl b/extra/jheidi/userManagerDialog.ajl index 10fe35f6..894779d8 100755 --- a/extra/jheidi/userManagerDialog.ajl +++ b/extra/jheidi/userManagerDialog.ajl @@ -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; diff --git a/extra/jheidi/userManagerEvents.ajl b/extra/jheidi/userManagerEvents.ajl index 37ca0bd8..749ec8b6 100755 --- a/extra/jheidi/userManagerEvents.ajl +++ b/extra/jheidi/userManagerEvents.ajl @@ -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;