--TEST-- mysqli_set_local_infile_handler() - nested calls --SKIPIF-- --INI-- mysqli.allow_local_infile=1 --FILE-- 0) { printf("[014] Test is too simple to handle a buffer of size %d that cannot hold all lines\n", $buflen); $error = 'Parser too simple'; } $buffer = ''; foreach ($lines as $k => $line) { if ('' === trim($line)) continue; $columns = explode(';', $line); if (empty($columns)) { printf("[015] Cannot parse columns\n"); $error = 'Cannot parse columns'; } // increase id column value $columns[0] += 1; $buffer .= implode(';', $columns); $buffer .= "\n"; } /* report the wrong length */ return strlen($buffer); } function callback_report_short_len($fp, &$buffer, $buflen, &$error) { static $invocation = 0; printf("Callback - report_short_len(): %d\n", $invocation++); return callback_simple($fp, $buffer, $buflen, $error); } $file = create_standard_csv(1); $expected = array( array('id' => 98, 'label' => 'x'), array('id' => 99, 'label' => 'y'), array('id' => 100, 'label' => 'z'), ); try_handler(20, $link, $file, 'callback_report_short_len', $expected); mysqli_close($link); print "done!"; ?> --CLEAN-- --EXPECTF-- Callback set to 'callback_report_short_len' Callback - report_short_len(): 0 Callback - callback_simple(): 0 Callback - report_short_len(): 1 Callback - callback_simple(): 1 done!