Skip to content

Commit

Permalink
Fixed 2 bug in Firebird side
Browse files Browse the repository at this point in the history
   a) geonameId field name being wrong.
   b) apostrophe was not escaped correctly.

Fixed bug in both Firebird and mySQL where both database fields are to small for languages as the largest so far is 87 characters. made field 100 to try and handle future entries that might grown.
  • Loading branch information
dominionit committed Dec 3, 2014
1 parent 9bc7fa4 commit 752d73c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $(document).ready(function () {
'continentName': "varchar(15) DEFAULT NULL",
'continent': "char(2) DEFAULT NULL",
'areaInSqKm': "varchar(20) DEFAULT NULL",
'languages': "varchar(30) DEFAULT NULL",
'languages': "varchar(100) DEFAULT NULL",
'isoAlpha3': "char(3) DEFAULT NULL",
'geonameId': "int(10) DEFAULT NULL"
};
Expand All @@ -36,9 +36,9 @@ $(document).ready(function () {
'continentName': "varchar(15) DEFAULT NULL",
'continent': "char(2) DEFAULT NULL",
'areaInSqKm': "varchar(20) DEFAULT NULL",
'languages': "varchar(30) DEFAULT NULL",
'languages': "varchar(100) DEFAULT NULL",
'isoAlpha3': "char(3) DEFAULT NULL",
'geonameId': "integer(10) DEFAULT NULL"
'geonameId': "integer DEFAULT NULL"
};

$('#showexamplecode').click(function (e) {
Expand Down Expand Up @@ -206,7 +206,7 @@ $(document).ready(function () {
for (var j = 0; j < oLength; j++) {
var currValue = allValues[i][options[j]];
if (typeof currValue === "string")
sql += "'" + currValue.replace(/\x27/g, '\\\x27') + "', ";
sql += "'" + currValue.replace(/\x27/g, 'x27x27') + "', ";
else if (typeof currValue === "number")
sql += "" + currValue + ", ";
}
Expand Down

0 comments on commit 752d73c

Please sign in to comment.