famsf / pecl-pdo-4d

SVN->Git of the PHP PECL PDO 4D extension http://svn.php.net/repository/pecl/pdo_4d/ plus bugfixes
3 stars 12 forks source link

Paging limit 100 #2

Open jasonpjohnson opened 9 years ago

jasonpjohnson commented 9 years ago

does this contain the fix for queries over 100 rows returned ?

Looks like there is someone who patched lib4d_sql for a python project(https://github.com/ibrewster/p4d) @ibrewster and patched those issues. I tried to drop the library in this project and recompile but I get an error.

-c /root/pdo_4d/4d_statement.c -fPIC -DPIC -o .libs/4d_statement.o /root/pdo_4d/4d_statement.c: In function 'pdo_4d_stmt_execute': /root/pdo_4d/4d_statement.c:61:3: error: too few arguments to function 'fourd_exec_statement' ./lib4d_sql/fourd.h:286:15: note: declared here /root/pdo_4d/4d_statement.c: In function 'pdo_4d_stmt_param_hook': /root/pdo_4d/4d_statement.c:363:10: warning: passing argument 5 of 'php_mb_convert_encoding' from incompatible pointer type [enabled by default] /usr/include/php5/ext/mbstring/mbstring.h:139:21: note: expected 'sizet ' but argument is of type 'int ' /root/pdo_4d/4d_statement.c:375:10: warning: passing argument 5 of 'php_mb_convert_encoding' from incompatible pointer type [enabled by default] /usr/include/php5/ext/mbstring/mbstring.h:139:21: note: expected 'size_t ' but argument is of type 'int ' make: _* [4d_statement.lo] Error 1

I can confirm the segfault @ 100 rows using this code

while ($row = $stmt->fetchObject()){ $i++; echo $i . PHP_EOL; array_push($results, $row); }

outputs

root@reports:~# php 4dpdotest.php 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 Segmentation fault (core dumped)

13rac1 commented 9 years ago

does this contain the fix for queries over 100 rows returned ?

Apparently not if it's still crashing! :laughing:

This only contains two patches right now, but that was enough for my needs. The details in the commit log: https://github.com/famsf/pecl-pdo-4d/commits/master I updated the extension entirely for this: https://github.com/famsf/4d-mysqldump It isn't pretty, but has been running in a weekly cron without fail on a ~4GB database for over two years now. There are multiple workarounds in the PHP for this extension. Most importantly, the extension has severe memory leaks so the PHP manages memory use using subprocesses. Haha, yep, I know.