UDF Repository for MySQL bugs - All Projects: Recently opened tasks http://bugs.mysqludf.org/ Feed for all projects 2010-03-19T21:20:30Z FS#20: \. is not correctly parsed http://bugs.mysqludf.org/?do=details&task_id=20 2010-03-19T21:20:30Z Anonymous user \. is not correctly parsed you have to do [\.] ex: SELECT PREG_CAPTURE("/\./", "a"); //returns a - should return null SELECT PREG_CAPTURE("/\./", "."); //correctly returns . SELECT PREG_CAPTURE("/[\.]/", "a"); //correctly returns null SELECT PREG_CAPTURE("/[\.]/", "."); //correctly returns .
ex:
SELECT PREG_CAPTURE("/\./", "a"); //returns a - should return null
SELECT PREG_CAPTURE("/\./", "."); //correctly returns .
SELECT PREG_CAPTURE("/[\.]/", "a"); //correctly returns null
SELECT PREG_CAPTURE("/[\.]/", "."); //correctly returns .]]>
FS#19: THE SYS_EXEC NOT WORKING http://bugs.mysqludf.org/?do=details&task_id=19 2010-01-21T12:38:31Z Anonymous user The sys_exec didn't execute the command in arg. I am trying execute a ruby script but nothing happens Neither the sys_eval is execute the command in arg I was try: mysql> SELECT sys_eval('id'); +----------------+ | sys_eval('id') | +----------------+ | | +----------------+ 1 row in set (0,00 sec) I am trying execute a ruby script but nothing happens
Neither the sys_eval is execute the command in arg
I was try:
mysql> SELECT sys_eval('id');
+----------------+
| sys_eval('id') |
+----------------+
| |
+----------------+
1 row in set (0,00 sec)
]]>
FS#18: 64 bit windows version requested http://bugs.mysqludf.org/?do=details&task_id=18 2009-12-15T02:08:32Z Anonymous user I downloaded the windows DLLs on your site and tried to apply them on our server. Unfortunately the binaries are 32 bit only and the MYSQL instance is 64 bit so they will not register. Can you put me in touch with the author? I would like to see if they could compile a 64 bit windows version to add to the binaries. I see that the source is available but I do not have the compiler in question.
Can you put me in touch with the author? I would like to see if they could compile a 64 bit windows version to add to the binaries. I see that the source is available but I do not have the compiler in question.


]]>
FS#16: Bad use of args->args[0] http://bugs.mysqludf.org/?do=details&task_id=16 2009-09-30T18:36:26Z Anonymous user In the code of all the functions, the variable args->args[0] is used without consider the length of the parameter string with args->lengths[0] args->args[0]
is used without consider the length of the parameter string with
args->lengths[0]
]]>
FS#15: lib_mysqludf_xql crashes mysqld process on windows after several queries http://bugs.mysqludf.org/?do=details&task_id=15 2009-11-23T22:53:12Z Anonymous user I'm using the binary build of lib_mysqludf_xql on wiindows and I'm having trouble where it crashes the mysqld daemon. I've been able to reporduce this with a very simple test case. I run the following query 500 times in two separate windows: select xql_element('my-element', 'my content $i') as value ; Here's the bash script that I use to run this query 500 times (run this from a remote linux box; update db host, db name, username, and password): #!/bin/bash target_host=123.456.789.123 for ((i=0; i < 500; i++)) do echo "before $i" mysql --xml -h $target_host --user=myuser --password=mypassword mydb << EOF select xql_element('my-element', 'my content $i') as value ; EOF echo "after $i" echo "before sleeping" sleep 0.1 echo "after sleeping" done When I'm running this script in two separate windows, it seems to die about 100 iterations in. I've also had mysql die when just running one copy of the script, but that's not as quick to produce (and it's made it through all 500 iterations without any problems a couple times). My real query builds a more complex xml document and it dies much sooner. Matt
I've been able to reporduce this with a very simple test case. I run the following query 500 times in two separate windows:

select
xql_element('my-element', 'my content $i') as value
;

Here's the bash script that I use to run this query 500 times (run this from a remote linux box; update db host, db name, username, and password):

#!/bin/bash
target_host=123.456.789.123
for ((i=0; i < 500; i++))
do
echo "before $i"
mysql --xml -h $target_host --user=myuser --password=mypassword mydb << EOF
select
xql_element('my-element', 'my content $i') as value
;
EOF
echo "after $i"
echo "before sleeping"
sleep 0.1
echo "after sleeping"
done


When I'm running this script in two separate windows, it seems to die about 100 iterations in. I've also had mysql die when just running one copy of the script, but that's not as quick to produce (and it's made it through all 500 iterations without any problems a couple times).

My real query builds a more complex xml document and it dies much sooner.

Matt]]>
FS#14: sys_exec is not executing the external commands http://bugs.mysqludf.org/?do=details&task_id=14 2009-08-12T16:35:49Z Anonymous user Hi All, Sorry, In my previous thread, my emaild was incorrect. I&#039;m trying to run the external command from sys_exec, but I could not. I&#039;m exactly trying to run a perl script, which intern deletes a directory. When I execute the below sql query it returning code is &quot;3328&quot; SELECT sys_exec(&#039;perl /root/temp/test.pl&#039;); When I checked the directory, it was not deleted, where as same command when I run through command line directory it&#039;s deleting the directory. some thing like &quot;perl /root/temp/test.pl&quot; Can any one suggest us, what might be problem and possible solution to it. To Install the sys_exec, I have followed the documentation provided on your site, as downloading lib_mysqludf_sys_0.0.3.tar and running the install.sh file. Any help is highly appreciated. Thanks.
Sorry, In my previous thread, my emaild was incorrect.

I'm trying to run the external command from sys_exec, but I could not.

I'm exactly trying to run a perl script, which intern deletes a directory.
When I execute the below sql query it returning code is "3328"
SELECT sys_exec('perl /root/temp/test.pl');

When I checked the directory, it was not deleted, where as same command when I run
through command line directory it's deleting the directory.

some thing like "perl /root/temp/test.pl"

Can any one suggest us, what might be problem and possible solution to it.

To Install the sys_exec, I have followed the documentation provided on your site,
as downloading lib_mysqludf_sys_0.0.3.tar and running the install.sh file.

Any help is highly appreciated.


Thanks.]]>
FS#11: Signal 11 when using sys_eval more than once http://bugs.mysqludf.org/?do=details&task_id=11 2009-01-26T22:37:11Z Anonymous user When using sys_eval, a SIG 11 is raised: select sys_eval(&#039;ls -l existing_file&#039;); select sys_eval(&#039;ls -l non_existing_file&#039;); The problem is that the malloc or realloc length is too short because result[outlen]=0 needs a length of outlen+1 There are also not tested returns of functions. And if result is null, the test !(*result) produces a core under Linux According to me, a better implementation would be : char* sys_eval( UDF_INIT *initid , UDF_ARGS *args , char* result , unsigned long* length , char *is_null , char *error ){ FILE *pipe; char line[1024]; unsigned long outlen, linelen; pipe = popen(args-&gt;args[0], &quot;r&quot;); if (pipe == NULL) { *is_null = 1; return NULL; } outlen = 0; result = NULL; while (fgets(line, sizeof(line), pipe) != NULL) { linelen = strlen(line); if (linelen &gt; 0) { if (outlen == 0) result = malloc(linelen + 1); else result = realloc(result, outlen + linelen + 1); if (result == NULL) break; strncpy(result + outlen, line, linelen); outlen = outlen + linelen; } } pclose(pipe); if (result == NULL || !(*result)) { *is_null = 1; } else { result[outlen] = 0x00; *length = strlen(result); } return result; } Hope it helps. Bernard select sys_eval('ls -l existing_file');
select sys_eval('ls -l non_existing_file');
The problem is that the malloc or realloc length is too short because result[outlen]=0 needs a length of outlen+1
There are also not tested returns of functions.
And if result is null, the test !(*result) produces a core under Linux
According to me, a better implementation would be :
char* sys_eval(
UDF_INIT *initid
, UDF_ARGS *args
, char* result
, unsigned long* length
, char *is_null
, char *error
){
FILE *pipe;
char line[1024];
unsigned long outlen, linelen;

pipe = popen(args->args[0], "r");
if (pipe == NULL) {
*is_null = 1;
return NULL;
}

outlen = 0;
result = NULL;

while (fgets(line, sizeof(line), pipe) != NULL) {
linelen = strlen(line);
if (linelen > 0) {
if (outlen == 0)
result = malloc(linelen + 1);
else
result = realloc(result, outlen + linelen + 1);
if (result == NULL) break;
strncpy(result + outlen, line, linelen);
outlen = outlen + linelen;
}
}

pclose(pipe);

if (result == NULL || !(*result)) {
*is_null = 1;
} else {
result[outlen] = 0x00;
*length = strlen(result);
}

return result;
}

Hope it helps.
Bernard]]>
FS#10: preg_replace(pattern, replacement, str) returns empty string when replacement is NULL http://bugs.mysqludf.org/?do=details&task_id=10 2009-01-23T16:57:16Z Anonymous user preg_replace(pattern, replacement, str) returns empty string when replacement is NULL mysql-5.1.22 mysql-5.1.22]]> FS#9: lib_mysqludf_json not work under Windows http://bugs.mysqludf.org/?do=details&task_id=9 2009-01-05T08:21:24Z Anonymous user This UDF works fine under Linux (both 32bit &amp; 64bit), but not under Windows (32bit). Test this: SELECT json_members(&#039;a&#039;, &#039;b&#039;); /* this works as expected */ SELECT json_object(json_members(&#039;a&#039;, &#039;b&#039;)); /* not work, throw an exception of &quot;Invalid json member name - name cannot contain &#039;(&#039;&quot;
Test this:

SELECT json_members('a', 'b'); /* this works as expected */
SELECT json_object(json_members('a', 'b')); /* not work, throw an exception of "Invalid json member name - name cannot contain '('"]]>
FS#6: Unable to process with utf8 string http://bugs.mysqludf.org/?do=details&task_id=6 2008-10-01T01:09:21Z Anonymous user SELECT json_values(&#039;???&#039;); returns: &quot;????? Even wrost: CREATE TABLE tt( idx INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, aa VARCHAR(100) NOT NULL ) DEFAULT CHARSET=utf8; INSERT INTO tt(aa) VALUES(&#039;a&#039;), (&#039;b&#039;), (&#039;aa&#039;), (&#039;abc&#039;), (&#039;???&#039;); SELECT json_values(aa) FROM tt WHERE idx = 5; returns: &quot;??????€???€?
returns:
"?????

Even wrost:
CREATE TABLE tt(
idx INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
aa VARCHAR(100) NOT NULL
) DEFAULT CHARSET=utf8;

INSERT INTO tt(aa) VALUES('a'), ('b'), ('aa'), ('abc'), ('???');

SELECT json_values(aa)
FROM tt
WHERE idx = 5;

returns:
"??????€???€?
]]>