[Home]

Summary:ASTERISK-12753: MYSQL INSERT Query length
Reporter:Ivo Kirilov (ariko)Labels:
Date Opened:2008-09-19 08:15:24Date Closed:2011-06-07 14:03:14
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Addons/app_mysql
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I use extensions stored in mysql and from these extensions call mysql queries using app_addon_sql_mysql.
everything is ok at all but when I call query with larger number of characters - greater that 495 chars- I got missing characters in the end and my mysql query crash.
Anyone notice this or fix this issue ?



****** ADDITIONAL INFORMATION ******

this is how looks the cutted query:
INSERT INTO `bill1` SET `call_date` = now(), `caller` = '7', `reseller` = '1',`called_number` = '0899957190', `duration` = '0', `bill_prefixr` = '089', `bill_prefixe` = '089', `sell_prefix` = '089', `descriptionr` = 'Bulgaria - Globul', `descriptione` = 'Bulgaria-Globul', `carrier` = '25',`sell_price_pmr` = '0.39', `sell_price_pme` = '0.4', `buy_price_pm` = '0.22', `total_sell_costr` = 0, `total_sell_coste` = 0,  `total_profitr` = 0, `total_profit` = 0, `profit_pmr` = 0.4 - 0.39, `profit_p

and shorter one

INSERT INTO `bill1` SET `call_date` = now(), `caller` = '7', `reseller` = '1',`called_number` = '0013019751000', `duration` = '5', `bill_prefixr` = '001', `bill_prefixe` = '001', `sell_prefix` = '001', `descriptionr` = 'USA', `descriptione` = 'USA', `carrier` = '25',`sell_price_pmr` = '0.03', `sell_price_pme` = '0.05', `buy_price_pm` = '0.00798', `total_sell_costr` = 0, `total_sell_coste` = 0,  `total_profitr` = 0, `total_profit` = 0, `profit_pmr` = 0.05 - 0.03, `profit_pm` = 0
Comments:By: Leif Madsen (lmadsen) 2008-09-19 08:30:29

This most likely has to do with the line length available in the Asterisk dialplan. If you need to run queries longer than this, a better method is really to use func_odbc to create a custom function in which you won't be restricted by the dialplan.

I'm gonna leave this open for now in case anyone else wants to comment on it, but I think this is just a line length restriction of the dialplan, and not an issue with the MYSQL() application itself.

By: Leif Madsen (lmadsen) 2008-09-19 11:40:04

Did you happen to define LOW_MEMORY in your compiler flags inside menuselect?

By: Tilghman Lesher (tilghman) 2008-09-23 16:04:31

If you have LOW_MEMORY defined, then your maximum line length in any particular configuration file will be 512 characters.  Otherwise, your maximum line length is 8192 characters.

By: Tilghman Lesher (tilghman) 2008-09-27 18:38:55

Given that there has been no response to the questions posed, I'm guessing that this is resolved by removing LOW_MEMORY from your menuselect options.