Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Python and MySQL

 
Post new topic   Reply to topic Printable version
 View previous topic  FreeBSD and Python problems Post :: Post <c> linking problems with strsplit  View next topic  
Author Message
Stagnate
Guest


Offline

PostPosted: Sat Sep 16, 2006 2:26 pm    Post subject: Python and MySQL Reply to topic Reply with quote

I have queries working, but the pyint declarations don't appear to match reality. It's entirely possible that I'm misreading the declarations or maybe working from old source (less likely).

From reldb.h:
Code: Show/Hide

   int (*Query)(query_callback cb, void *clos, int notifyfail, const char *fmt, ...);
   /* pyint: (int, db_res, clos -> void) dynamic failval 0, clos, int, string -> int */


It appears that the correct definition is (int, db_res) for the callback function (status and result) and (string, int, string) for the query (name of callback function, error notify(?), query string)

However I don't understand what dynamic failval 0 means. The int returned from the query seemed to increment in my first test, but never after that. Is it a status marker, an index of the query, or something else?

Code: Show/Hide

   int (*EscapeString)(const char *str, char *buf, int buflen);
   /* pyint: string, string out, int buflen -> int */


This seems to take a single argument in (string) and output a tuple (int status, escaped string).

Some other notes based on initial work...

First, the option of passing a pointer to handle query related data isn't available, but I think that a queue will work. Is there any circumstance where queries might return out of order?

Second, I can't get the MySQL error and python errors in the logs. It shows up on console. Is there something that I'm missing? I have log set to DIMWE.

Also, last_insert_id is not safe without careful handling, since multiple modules can do inserts. Is it possible to add a flag to the query to have it automatically return the insert ID to guarantee validity? Pretty low priority for me but handy.
Back to top
Stagnate
Guest


Offline

PostPosted: Sat Sep 16, 2006 2:36 pm    Post subject: Reply to topic Reply with quote

I see that a pointer used to output data is not passed as an argument, but is in the output as a tuple, so the second issue is resolved.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 56 page(s) served in previous 5 minutes.

phpBB Created this page in 0.468931 seconds : 26 queries executed (95.8%): GZIP compression disabled