Hi, SQL Counter has a hardcoded limit for the length of SQL query to probably 1024 bytes. When query string is longer freeradius debug shows: "sql: Insufficient query buffer space" It seems to be not sufficient in the case of longer, more sophisticated queries, e.g. when the timezone conversions must be applied few times in the single query string or query logic shall contain other data subsets. Some our queries reach almost 1500 bytes... Is there any other way to define 'long query' SQL statement to be correctly processed by sqlcounter module? Regards, Mike ________________________________________ Uwaga: Tre?? niniejszej wiadomo?ci mo?e by? poufna i obj?ta zakazem jej ujawniania. Je?li czytelnik tej wiadomo?ci nie jest jej zamierzonym adresatem, pracownikiem lub po?rednikiem upowa?nionym do jej przekazania adresatowi, informujemy ?e wszelkie rozprowadzanie, rozpowszechnianie lub powielanie niniejszej wiadomo?ci jest zabronione. Je?li otrzyma?e? t? wiadomo?? omy?kowo, prosz? bezzw?ocznie odes?a? j? nadawcy, a sam? wiadomo?? usun?? z komputera. Dzi?kujemy. ________________________________ Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.If you have received this communication in error, please notify the sender immediately by replying to the message and deleting it from your computer. Thank you. ________________________________
On 23 Sep 2015, at 16:59, Michal Tomaszewski <Michal.Tomaszewski@cca.pl> wrote:
Hi,
SQL Counter has a hardcoded limit for the length of SQL query to probably 1024 bytes. When query string is longer freeradius debug shows: "sql: Insufficient query buffer space"
It seems to be not sufficient in the case of longer, more sophisticated queries, e.g. when the timezone conversions must be applied few times in the single query string or query logic shall contain other data subsets. Some our queries reach almost 1500 bytes...
Is there any other way to define 'long query' SQL statement to be correctly processed by sqlcounter module?
Not currently. Maybe in v3.1.x HEAD. I can make the changes if you're willing to test. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS development team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
It seems to be not sufficient in the case of longer, more sophisticated
queries, e.g. when the timezone conversions must be applied few times in the single query string or query logic shall contain other data subsets.
Some our queries reach almost 1500 bytes...
Is there any other way to define 'long query' SQL statement to be correctly processed by sqlcounter module?
Not currently. Maybe in v3.1.x HEAD. I can make the changes if you're willing to test.
Thank you Arran. Is it enough to change #define MAX_QUERY_LEN 1024 in rlm_sqlcounter.c into higher value? ________________________________________ Uwaga: Treść niniejszej wiadomości może być poufna i objęta zakazem jej ujawniania. Jeśli czytelnik tej wiadomości nie jest jej zamierzonym adresatem, pracownikiem lub pośrednikiem upoważnionym do jej przekazania adresatowi, informujemy że wszelkie rozprowadzanie, rozpowszechnianie lub powielanie niniejszej wiadomości jest zabronione. Jeśli otrzymałeś tę wiadomość omyłkowo, proszę bezzwłocznie odesłać ją nadawcy, a samą wiadomość usunąć z komputera. Dziękujemy. ________________________________ Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.If you have received this communication in error, please notify the sender immediately by replying to the message and deleting it from your computer. Thank you. ________________________________
On 24 Sep 2015, at 09:02, Michal Tomaszewski <Michal.Tomaszewski@cca.pl> wrote:
It seems to be not sufficient in the case of longer, more sophisticated
queries, e.g. when the timezone conversions must be applied few times in the single query string or query logic shall contain other data subsets.
Some our queries reach almost 1500 bytes...
Is there any other way to define 'long query' SQL statement to be correctly processed by sqlcounter module?
Not currently. Maybe in v3.1.x HEAD. I can make the changes if you're willing to test.
Thank you Arran.
Is it enough to change #define MAX_QUERY_LEN 1024 in rlm_sqlcounter.c into higher value?
Yep. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS development team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
Yep.
-Arran
Thank you! ________________________________________ Uwaga: Treść niniejszej wiadomości może być poufna i objęta zakazem jej ujawniania. Jeśli czytelnik tej wiadomości nie jest jej zamierzonym adresatem, pracownikiem lub pośrednikiem upoważnionym do jej przekazania adresatowi, informujemy że wszelkie rozprowadzanie, rozpowszechnianie lub powielanie niniejszej wiadomości jest zabronione. Jeśli otrzymałeś tę wiadomość omyłkowo, proszę bezzwłocznie odesłać ją nadawcy, a samą wiadomość usunąć z komputera. Dziękujemy. ________________________________ Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.If you have received this communication in error, please notify the sender immediately by replying to the message and deleting it from your computer. Thank you. ________________________________
On 23-09-15 22:59, Michal Tomaszewski wrote:
Hi,
SQL Counter has a hardcoded limit for the length of SQL query to probably 1024 bytes. When query string is longer freeradius debug shows: "sql: Insufficient query buffer space"
It seems to be not sufficient in the case of longer, more sophisticated queries, e.g. when the timezone conversions must be applied few times in the single query string or query logic shall contain other data subsets. Some our queries reach almost 1500 bytes...
Is there any other way to define 'long query' SQL statement to be correctly processed by sqlcounter module?
Another workaround that doesn't required custom builds of FreeRADIUS: if your database-server supports stored procedures you could move all the logic there and keep the queries in the FR-config short. -- Herwin Weststrate
Another workaround that doesn't required custom builds of FreeRADIUS: if your database-server supports stored procedures you could move all the logic there and keep the queries in the FR-config short.
Thanks Herwin, We did that but it requires non-standard database schema... Both options - custom build and non-standard schema - require additional effort during deployment... The best solution would be not change anything and keep repo configuration of freeradius. That is why I was looking for another workaround. Regards, Mike ________________________________________ Uwaga: Treść niniejszej wiadomości może być poufna i objęta zakazem jej ujawniania. Jeśli czytelnik tej wiadomości nie jest jej zamierzonym adresatem, pracownikiem lub pośrednikiem upoważnionym do jej przekazania adresatowi, informujemy że wszelkie rozprowadzanie, rozpowszechnianie lub powielanie niniejszej wiadomości jest zabronione. Jeśli otrzymałeś tę wiadomość omyłkowo, proszę bezzwłocznie odesłać ją nadawcy, a samą wiadomość usunąć z komputera. Dziękujemy. ________________________________ Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.If you have received this communication in error, please notify the sender immediately by replying to the message and deleting it from your computer. Thank you. ________________________________
On Sep 24, 2015, at 10:32 AM, Michal Tomaszewski <Michal.Tomaszewski@cca.pl> wrote:
We did that but it requires non-standard database schema... Both options - custom build and non-standard schema - require additional effort during deployment... The best solution would be not change anything and keep repo configuration of freeradius. That is why I was looking for another workaround.
I've changed the default query length for sqlcounter to 2K, instead of 1K. It's a small change, and worth making in 3.0. Alan DeKok.
I've changed the default query length for sqlcounter to 2K, instead of 1K. It's a small change, and worth making in 3.0.
Alan DeKok.
Thanks Alan a lot! I'm impressed. It is a really big help for our project. Regards, Mike ________________________________________ Uwaga: Treść niniejszej wiadomości może być poufna i objęta zakazem jej ujawniania. Jeśli czytelnik tej wiadomości nie jest jej zamierzonym adresatem, pracownikiem lub pośrednikiem upoważnionym do jej przekazania adresatowi, informujemy że wszelkie rozprowadzanie, rozpowszechnianie lub powielanie niniejszej wiadomości jest zabronione. Jeśli otrzymałeś tę wiadomość omyłkowo, proszę bezzwłocznie odesłać ją nadawcy, a samą wiadomość usunąć z komputera. Dziękujemy. ________________________________ Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.If you have received this communication in error, please notify the sender immediately by replying to the message and deleting it from your computer. Thank you. ________________________________
participants (4)
-
Alan DeKok -
Arran Cudbard-Bell -
Herwin Weststrate -
Michal Tomaszewski