summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2011-03-31 18:40:46 (GMT)
committerChristian Pointner <equinox@helsinki.at>2011-03-31 18:40:46 (GMT)
commitfdd96c527de9e5987c1f8592d1751c3bdc31c9c8 (patch)
treea33c1692aa21e8435b727fee58dbacab389e141c
parent8b055af834bb6de93519bbb0bff776ebb7fffe73 (diff)
fixed utf-8 @ rddb
switched to bigint for timestamp
-rw-r--r--rhnop-server/debian/changelog7
-rw-r--r--rhnop-server/playlog.lua5
-rw-r--r--rhnop-server/rddb.lua7
3 files changed, 16 insertions, 3 deletions
diff --git a/rhnop-server/debian/changelog b/rhnop-server/debian/changelog
index 29e913f..a19e45b 100644
--- a/rhnop-server/debian/changelog
+++ b/rhnop-server/debian/changelog
@@ -1,3 +1,10 @@
+rhnop-server (0.7) unstable; urgency=low
+
+ * fixed utf-8 handling.
+ * changed to bigint for timestamp.
+
+ -- Christian Pointner <equinox@helsinki> Wed, 31 Mar 2011 20:39:52 +0200
+
rhnop-server (0.6) unstable; urgency=low
* fixed handling of invalid carts.
diff --git a/rhnop-server/playlog.lua b/rhnop-server/playlog.lua
index 99fc5fe..59e572c 100644
--- a/rhnop-server/playlog.lua
+++ b/rhnop-server/playlog.lua
@@ -22,9 +22,10 @@
require "luasql.mysql"
-- CREATE DATABASE rhnop
--- GRANT select,insert,update ON rhnop.* TO 'nopsyncd' IDENTIFIED BY '123456';
+-- GRANT select,insert,update ON rhnop.* TO 'nopsyncd' IDENTIFIED BY '<password>';
+-- GRANT select ON rhnop.* TO 'nopcollectd' IDENTIFIED BY '<password>';
-- USE rhnop
--- CREATE TABLE IF NOT EXISTS now (timestamp VARCHAR(16) PRIMARY KEY NOT NULL, cart INT NOT NULL, len INT, showtitle VARCHAR(255), title VARCHAR(255), artist VARCHAR(255), album VARCHAR(255), ismusic BOOLEAN);
+-- CREATE TABLE IF NOT EXISTS now (timestamp BIGINT UNSIGNED PRIMARY KEY NOT NULL, cart INT NOT NULL, len INT, showtitle VARCHAR(255), title VARCHAR(255), artist VARCHAR(255), album VARCHAR(255), ismusic BOOLEAN);
conf = require "conf"
diff --git a/rhnop-server/rddb.lua b/rhnop-server/rddb.lua
index c8037a9..f1cc656 100644
--- a/rhnop-server/rddb.lua
+++ b/rhnop-server/rddb.lua
@@ -38,11 +38,16 @@ function rddb:init()
return nil, err
end
+ local ret, err = self.con:execute("SET CHARACTER SET utf8")
+ if ret == nil then
+ return nil, err
+ end
+
return true
end
function rddb:getCartInfo(cartnum)
- local cur, err = self.con:execute("select TITLE,ARTIST,ALBUM from CART where NUMBER = " .. self.con:escape(cartnum));
+ local cur, err = self.con:execute("select TITLE,ARTIST,ALBUM from CART where NUMBER = " .. self.con:escape(cartnum))
if cur == nil then
return nil, err
end