THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#193 - no avpops bigint handling breaks custom select queries
User who did this - Walter Doekes (wdoekes)
----------
> AFAIK mysql does not support casting from bigint to int
Indeed, when figuring out what was broken, I tried the CAST(.. UNSIGNED / TINYINT) but it all failed. First the cast to CHAR returned something usable.
> Or alternative, modparam for avpops (and eventually sqlops) to control the handling of bigints returned by mysql:
I like that option. It introduces a place to document reasons for one or the other. ("Are you using big numbers? Use the string. Are you just affected by mysql automatic type selection in dynamic column values? Choose int.")
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=193#comment471
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#193 - no avpops bigint handling breaks custom select queries
User who did this - Daniel-Constantin Mierla (miconda)
----------
Or alternative, modparam for avpops (and eventually sqlops) to control the handling of bigints returned by mysql:
- cast to int
- cast to str
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=193#comment470
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
Module: sip-router
Branch: master
Commit: 8f5183a3416cadad7d4afac36721b8f972e310b1
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8f5183a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Mon Dec 19 13:18:54 2011 +0100
registrar(k): maintaining one contact per AoR has priority over max_contacts
- when using save() with the flags to keep only one contact per AoR,
max_contacts limit is no longer applied, as it is not matching the
demants of save() when max_contacts=1
- partch by Walter Doekes, closes FS#192
---
modules_k/registrar/save.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules_k/registrar/save.c b/modules_k/registrar/save.c
index caa5465..8ff9ce7 100644
--- a/modules_k/registrar/save.c
+++ b/modules_k/registrar/save.c
@@ -563,7 +563,7 @@ static inline int update_contacts(struct sip_msg* _m, urecord_t* _r,
goto error;
}
- if (cfg_get(registrar, registrar_cfg, max_contacts)) {
+ if (!_mode && cfg_get(registrar, registrar_cfg, max_contacts)) {
_c = get_first_contact(_m);
if(test_max_contacts(_m, _r, _c, ci) != 0)
goto error;
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#193 - no avpops bigint handling breaks custom select queries
User who did this - Daniel-Constantin Mierla (miconda)
----------
I see the points in your situation, but for generic case, casting big int to int can result in truncation. So if one wants to do it, better do it on demand in the config (note that it is memory operations, barely affects performances). Many can use it just to add it to headers or print it, which is just fine when kept as string in avp, as opposite to have a truncated value, without any control on it.
For your case casting should do the job, but AFAIK mysql does not support casting from bigint to int, but you can write a small function to do that - take big int as parameter and just return it back as int.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=193#comment469
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#193 - no avpops bigint handling breaks custom select queries
User who did this - Walter Doekes (wdoekes)
----------
Well.. only if that made sense. But it doesn't.
See my example:
id => int
IFNULL(id, 1) => string => ugly casts
I haven't touched any big numbers and suddenly I'm required to handle them through a string. I'm not saying this is kamailios fault -- mysql is to blame here (I think) for choosing the largest int possible -- but fixing this through a string cast doesn't make it any more intuitive.
I'm not fond of that solution at all.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=193#comment468
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#193 - no avpops bigint handling breaks custom select queries
User who did this - Daniel-Constantin Mierla (miconda)
----------
SQLOPS module converts bigint to string value, wouldn't be better to do the same in avpops? The use {s.int} transformation in cfg to get the int value.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=193#comment467
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#192 - a74f12d6 (3.2) registrar breaks save(..., 0x4) functionality
User who did this - Daniel-Constantin Mierla (miconda)
----------
Indeed max_contacts has higher priority in checking the location operations.
max_contact is like a limit of how many contacts one AoR can upload to location records, while the flag is the kind of: delete all existing (even more than 1) and add the one from current REGISTER.
It's not easy say for sure what would be the best, perhaps the parameter flag should be taken in consideration first like in your patch, being the will of executed function, thus I am going to apply the patch.
REPL in REG_SAVE_REPL_FL is for REPLACE - replace all existing contacts, the abbreviation might be confusing indeed.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=192#comment466
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Walter Doekes (wdoekes)
Attached to Project - sip-router
Summary - no avpops bigint handling breaks custom select queries
Task Type - Bug Report
Category - libsrdb1 (kamailio)
Status - Assigned
Assigned To - Henning Westerholt
Operating System - All
Severity - Medium
Priority - Normal
Reported Version - Development
Due in Version - Undecided
Due Date - Undecided
Details - Hi,
If I do this query:
avp_query("SELECT 1, id, IFNULL(id, 3) FROM sometable WHERE id = 1", "$avp(val1),$avp(val2),$avp(val3)");
I expect these values in val1..val3:
1 1 1
However, I get these values:
<null> 1 <null>
This is because there is not DB1_BIGINT handling in avpops_db.c. Only the 'id' fields gets read correctly, because it is of type integer (32bits).
I'm using avpops.so and db_mysql.so on 3.2.x.
Attached patch fixes that it works. But it won't fix actual bigint handling for numbers larger than 32bit on systems where sizeof(int) < 8.
Regards,
Walter Doekes
OSSO B.V.
One or more files have been attached.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=193
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A user has added themself to the list of users assigned to this task.
FS#193 - no avpops bigint handling breaks custom select queries
User who did this - Walter Doekes (wdoekes)
http://sip-router.org/tracker/index.php?do=details&task_id=193
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Walter Doekes (wdoekes)
Attached to Project - sip-router
Summary - a74f12d6 (3.2) registrar breaks save(..., 0x4) functionality
Task Type - Bug Report
Category - registrar (k)
Status - Assigned
Assigned To - Daniel-Constantin Mierla
Operating System - All
Severity - Medium
Priority - Normal
Reported Version - Development
Due in Version - Undecided
Due Date - Undecided
Details - Hi,
I'm trying to maintain only one Contact per AOR. But I want the last register to count:
http://www.kamailio.org/docs/modules/3.2.x/modules_k/registrar.html#id24945…
modparam("registrar", "max_contacts", 1)
http://www.kamailio.org/docs/modules/3.2.x/modules_k/registrar.html#id24979…
save("location", 0x4);
This fails. As far as I can see because this got added in a74f12d6:
a74f12d6 (Daniel-Constantin Mierla 2011-06-04 10:22:09 +0200 566) if (cfg_get(registrar, registrar_cfg, max_contacts)) {
a74f12d6 (Daniel-Constantin Mierla 2011-06-04 10:22:09 +0200 567) _c = get_first_contact(_m);
a74f12d6 (Daniel-Constantin Mierla 2011-06-04 10:22:09 +0200 568) if(test_max_contacts(_m, _r, _c, ci) != 0)
a74f12d6 (Daniel-Constantin Mierla 2011-06-04 10:22:09 +0200 569) goto error;
a74f12d6 (Daniel-Constantin Mierla 2011-06-04 10:22:09 +0200 570) }
After all, the _mode -- which supposedly contains whether it should overwrite existing contacts -- isn't checked here.
Attached, a patch that fixes it. I am however a little confused by the naming of _mode and REG_SAVE_REPL_FL. Neither conveys any meaning about what we're trying to do; which is overwriting (REG_SAVE_OVERWRITE_FL? _should_overwrite?)
Have I misunderstood the documentation?
Regards,
Walter Doekes
OSSO B.V.
One or more files have been attached.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=192
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.