From fdd96c527de9e5987c1f8592d1751c3bdc31c9c8 Mon Sep 17 00:00:00 2001
From: Christian Pointner <equinox@helsinki.at>
Date: Thu, 31 Mar 2011 18:40:46 +0000
Subject: fixed utf-8 @ rddb switched to bigint for timestamp


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
-- 
cgit v0.10.2