diff options
author | Marius <mariausol@gmail.com> | 2013-02-26 01:40:31 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2013-02-26 01:40:31 +0200 |
commit | 0d5087c4edd28707b198afabd26016fe922c6e35 (patch) | |
tree | 4fb23acb74c0c046a91dc4d1006b689d89448d49 /tex/context/base/util-sql-tickets.lua | |
parent | f6b142ac209f26e0164dd37933dd622251f9564c (diff) | |
download | context-0d5087c4edd28707b198afabd26016fe922c6e35.tar.gz |
beta 2013.02.26 00:17
Diffstat (limited to 'tex/context/base/util-sql-tickets.lua')
-rw-r--r-- | tex/context/base/util-sql-tickets.lua | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/tex/context/base/util-sql-tickets.lua b/tex/context/base/util-sql-tickets.lua index 63bbf4d44..41010d265 100644 --- a/tex/context/base/util-sql-tickets.lua +++ b/tex/context/base/util-sql-tickets.lua @@ -229,6 +229,9 @@ function tickets.save(db,ticket) local data = db.serialize(ticket.data or { },"return") local status = ticket.status or s_error +-- print("SETTING") +-- inspect(data) + ticket.status = status ticket.accessed = time @@ -320,7 +323,7 @@ local template_yes =[[ FROM %basename% ORDER BY - `created` ; + `id` ; ]] local template_nop =[[ @@ -332,7 +335,7 @@ local template_nop =[[ FROM %basename% ORDER BY - `created` ; + `id` ; ]] function tickets.collect(db,nodata) @@ -375,7 +378,7 @@ local template_cleanup_yes =[[ WHERE `accessed` < %time% ORDER BY - `created` ; + `id` ; ]] .. template local template_cleanup_nop =[[ @@ -390,7 +393,7 @@ local template_cleanup_nop =[[ WHERE `accessed` < %time% ORDER BY - `created` ; + `id` ; ]] .. template function tickets.cleanupdb(db,delta,nodata) -- maybe delta in db @@ -426,7 +429,10 @@ local template =[[ FROM %basename% WHERE - `token` = '%token%' ; + `token` = '%token%' + ORDER BY + `id` + ; ]] function tickets.getstatus(db,token) @@ -451,7 +457,10 @@ local template =[[ FROM %basename% WHERE - `status` >= %rubish% OR `accessed` < %time% ; + `status` >= %rubish% OR `accessed` < %time% + ORDER BY + `id` + ; ]] function tickets.getobsolete(db,delta) @@ -685,7 +694,7 @@ local template =[[ WHERE `token` = '%token%' ORDER BY - `created` ; + `id` ; ]] function tickets.getticketsbytoken(db,token) @@ -712,7 +721,7 @@ local template =[[ WHERE `usertoken` = '%usertoken%' AND `status` < %rubish% ORDER BY - `created` ; + `id` ; ]] function tickets.getusertickets(db,usertoken) |