Skip to content

Commit fdaf1bf

Browse files
committed
string escaping(?)
1 parent a5170f3 commit fdaf1bf

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

sql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def insertQuery(query):
3838
)
3939

4040
mycursor = mydb.cursor()
41-
mycursor.execute(query)
41+
mycursor.execute("", (query))
4242

4343
mydb.commit()
4444

surftimer/ck_playerrank.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ async def updatePlayerRankPoints(
127127
data.steamid32,
128128
data.style,
129129
)
130+
130131
xquery = insertQuery(sql)
131132

132133
content_data = {"updated": xquery, "xtime": time.perf_counter() - tic}

surftimer/queries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
## ck_playerrank
6262
sql_createPlayerRank = "CREATE TABLE IF NOT EXISTS `ck_playerrank` (`steamid` varchar(32) NOT NULL DEFAULT '', `steamid64` varchar(64) DEFAULT NULL, `name` varchar(64) DEFAULT NULL, `country` varchar(32) DEFAULT NULL, `countryCode` varchar(3) DEFAULT NULL, `continentCode` varchar(3) DEFAULT NULL, `points` int(12) DEFAULT '0', `wrpoints` int(12) NOT NULL DEFAULT '0', `wrbpoints` int(12) NOT NULL DEFAULT '0', `wrcppoints` int(11) NOT NULL DEFAULT '0', `top10points` int(12) NOT NULL DEFAULT '0', `groupspoints` int(12) NOT NULL DEFAULT '0', `mappoints` int(11) NOT NULL DEFAULT '0', `bonuspoints` int(12) NOT NULL DEFAULT '0', `finishedmaps` int(12) DEFAULT '0', `finishedmapspro` int(12) DEFAULT '0', `finishedbonuses` int(12) NOT NULL DEFAULT '0', `finishedstages` int(12) NOT NULL DEFAULT '0', `wrs` int(12) NOT NULL DEFAULT '0', `wrbs` int(12) NOT NULL DEFAULT '0', `wrcps` int(12) NOT NULL DEFAULT '0', `top10s` int(12) NOT NULL DEFAULT '0', `groups` int(12) NOT NULL DEFAULT '0', `lastseen` int(64) DEFAULT NULL, `joined` int(64) NOT NULL, `timealive` int(64) NOT NULL DEFAULT '0', `timespec` int(64) NOT NULL DEFAULT '0', `connections` int(64) NOT NULL DEFAULT '1', `readchangelog` int(11) NOT NULL DEFAULT '0', `style` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`steamid`, `style`)) DEFAULT CHARSET=utf8mb4;"
6363
sql_insertPlayerRank = "INSERT INTO ck_playerrank (steamid, steamid64, name, country, countryCode, continentCode, joined, style) VALUES('{}', '{}', '{}', '{}', '{}', '{}', {}, {})"
64-
sql_updatePlayerRankPoints = "UPDATE ck_playerrank SET name ='{}', points ={}, wrpoints = {}, wrbpoints = {}, wrcppoints = {}, top10points = {}, groupspoints = {}, mappoints = {}, bonuspoints = {}, finishedmapspro={}, finishedbonuses = {}, finishedstages = {}, wrs = {}, wrbs = {}, wrcps = {}, top10s = {}, `groups` = {} where steamid='{}' AND style = {};"
64+
sql_updatePlayerRankPoints = "UPDATE ck_playerrank SET `name` ='{}', points ={}, wrpoints = {}, wrbpoints = {}, wrcppoints = {}, top10points = {}, groupspoints = {}, mappoints = {}, bonuspoints = {}, finishedmapspro={}, finishedbonuses = {}, finishedstages = {}, wrs = {}, wrbs = {}, wrcps = {}, top10s = {}, `groups` = {} where steamid='{}' AND style = {};"
6565
sql_updatePlayerRankPoints2 = "UPDATE ck_playerrank SET name ='{}', points ={}, wrpoints = {}, wrbpoints = {}, wrcppoints = {}, top10points = {}, groupspoints = {}, mappoints = {}, bonuspoints = {}, finishedmapspro={}, finishedbonuses = {}, finishedstages = {}, wrs = {}, wrbs = {}, wrcps = {}, top10s = {}, `groups` = {}, country = '{}', countryCode = '{}', continentCode = '{}' where steamid='{}' AND style = {};"
6666
sql_updatePlayerRank = "UPDATE ck_playerrank SET finishedmaps ='{}', finishedmapspro='{}' where steamid='{}' AND style = '{}';"
6767
sql_selectPlayerName = "SELECT name FROM ck_playerrank where steamid = '{}'"

0 commit comments

Comments
 (0)