02.09.2013, 19:00
(
Последний раз редактировалось Misiur; 02.09.2013 в 19:40.
)
Usually I act like a smartass, but today is my dumb day! I'm staring at the sources but I'm all out of coffee and can't make anything out of it
1. IIRC inline functions are inserted directly into code. Now, when I do something like
Is this still a threaded query, or does it require the callback to be... a callback?
2. Is it possible to use transactions via blueg plugin (I've got r31)?
Exhibit 1:
Exhibit 2 - chained:
Would any of those work?
I don't quite grasp concept of threaded queries (except that each query is separate, and in case there are multiple cpu threads available, they'll be used or something like that), so sorry for my ignorance.
@update:
Awesome, transactions work as planned! (exhibit 1 code used). Question 1 still stands
1. IIRC inline functions are inserted directly into code. Now, when I do something like
pawn Код:
CallStuff() {
inline DealWithIt() {
new
rows,
cols;
cache_get_data(rows, cols, dbhandle);
printf("We got something Mike! %d %d", rows, cols);
}
mysql_tquery(dbhandle, "SELECT 2+2 AS hamster FROM dual", using inline DealWithIt, "");
}
2. Is it possible to use transactions via blueg plugin (I've got r31)?
Exhibit 1:
pawn Код:
CallStuff() {
mysql_tquery(dbhandle, "START TRANSACTION", "", "");
mysql_tquery(dbhandle, "SELECT 'Do something meaningful' AS hamster FROM dual", "", "");
mysql_tquery(dbhandle, "SELECT 'Or not' AS hamster FROM dual", "", "");
mysql_tquery(dbhandle, "COMMIT", "", "");
}
pawn Код:
CallStuff() {
inline S1() {
inline S2() {
inline S3() {
inline S4() {
printf("Dealt with it!");
}
mysql_tquery(dbhandle, "COMMIT", using inline S4, "");
}
mysql_tquery(dbhandle, "SELECT 'Or not' AS hamster FROM dual", using inline S3, "");
}
mysql_tquery(dbhandle, "SELECT 'Do something meaningful' AS hamster FROM dual", using inline S2, "");
}
mysql_tquery(dbhandle, "START TRANSACTION", using inline S1, "");
}
I don't quite grasp concept of threaded queries (except that each query is separate, and in case there are multiple cpu threads available, they'll be used or something like that), so sorry for my ignorance.
@update:
Awesome, transactions work as planned! (exhibit 1 code used). Question 1 still stands