mysql-udf

How to do a regular expression replace in MySQL?

。_饼干妹妹 提交于 2020-01-04 14:00:35
问题 I have a table with ~500k rows; varchar(255) UTF8 column filename contains a file name; I'm trying to strip out various strange characters out of the filename - thought I'd use a character class: [^a-zA-Z0-9()_ .\-] Now, is there a function in MySQL that lets you replace through a regular expression ? I'm looking for a similar functionality to REPLACE() function - simplified example follows: SELECT REPLACE('stackowerflow', 'ower', 'over'); Output: "stackoverflow" /* does something like this

Invoking an HTTP GET request through MySQL by executing native operating system's commands like curl

ぐ巨炮叔叔 提交于 2019-12-24 03:35:49
问题 I am using MySQL 5.6.11 running on 32-bit Microsoft Windows XP (Professional Version 2002 Service Pack 3). I installed the MySQL sys_exec UDF. Since I am running on 32-bit Windows, I used this lib_mysqludf_sys.dll (placed under C:\Program Files\MySQL\MySQL Server 5.6\lib\plugin\ as it is the default installation). Afterwards, the following command was executed (after logging in into an already created database). mysql> CREATE FUNCTION sys_exec RETURNS INT SONAME 'lib_mysqludf_sys.dll'; Query

mysql udf json_extract in where clause - how to improve performance

拥有回忆 提交于 2019-12-11 07:17:44
问题 How can I efficiently search json data in a mysql database? I installed the extract_json udf from labs.mysql.com and played around with a test table with 2.750.000 entries. CREATE TABLE `testdb`.`JSON_TEST_TABLE` ( `AUTO_ID` INT UNSIGNED NOT NULL AUTO_INCREMENT, `OP_ID` INT NULL, `JSON` LONGTEXT NULL, PRIMARY KEY (`AUTO_ID`)) $$ An example JSON field would look like so: {"ts": "2014-10-30 15:08:56 (9400.223725848107) ", "operation": "1846922"} I found that putting json_extract into a select

MySQL UDF That does a REGEX Search and Replace

▼魔方 西西 提交于 2019-12-11 02:35:14
问题 Hello I'm a new web developer at open.uwec.edu. I recently had to switch over our web servers and have come across some challenges. Our old MySQL server used a function from the lib_mysqludf_preg library called preg_replace to do regular expression searching and matching. It had some .dlls already compiled in the "MySQL Server 5.1/lib/plugin" folder called lib_mysqludf_preg.dll and libpcre.dll. If I copy these dlls over to the new server at "MySQL Server 5.6/lib/plugin" and do something like.

How to do a regular expression replace in MySQL?

白昼怎懂夜的黑 提交于 2019-11-25 21:36:35
问题 I have a table with ~500k rows; varchar(255) UTF8 column filename contains a file name; I\'m trying to strip out various strange characters out of the filename - thought I\'d use a character class: [^a-zA-Z0-9()_ .\\-] Now, is there a function in MySQL that lets you replace through a regular expression ? I\'m looking for a similar functionality to REPLACE() function - simplified example follows: SELECT REPLACE(\'stackowerflow\', \'ower\', \'over\'); Output: \"stackoverflow\" /* does something