mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-12 19:50:50 +00:00
Compare commits
59
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5fff8fae9b | ||
|
|
d824c3e5fb | ||
|
|
21341834d4 | ||
|
|
5346d0ae69 | ||
|
|
a668ce82de | ||
|
|
1e5f414394 | ||
|
|
a53d67ceac | ||
|
|
c0a1c2c5ee | ||
|
|
40d9e3ab86 | ||
|
|
54248b18fe | ||
|
|
10c9d615de | ||
|
|
a221e17b41 | ||
|
|
e450621f5e | ||
|
|
4922049213 | ||
|
|
f3d5877845 | ||
|
|
44b234a9bc | ||
|
|
20e75329f2 | ||
|
|
65f5573bc8 | ||
|
|
bd093ad861 | ||
|
|
a83cc03c13 | ||
|
|
8588ae7215 | ||
|
|
8f8e6f95af | ||
|
|
0f6c41c6f8 | ||
|
|
0697a64f7e | ||
|
|
5d5c1cea5f | ||
|
|
d386ed1e6b | ||
|
|
f2833ca1be | ||
|
|
d6fcaf5da4 | ||
|
|
c283f53b24 | ||
|
|
ecee3f1209 | ||
|
|
5e15c9c41f | ||
|
|
b855907f54 | ||
|
|
685708160e | ||
|
|
3430d856ac | ||
|
|
4e30ab33d8 | ||
|
|
07c5efbd76 | ||
|
|
4a10037cb4 | ||
|
|
0f579fd7c8 | ||
|
|
5240f8391f | ||
|
|
ea372e7463 | ||
|
|
2fb12be84c | ||
|
|
233f507fe6 | ||
|
|
e3e67b721f | ||
|
|
97d192b444 | ||
|
|
706241f82d | ||
|
|
d016434ad3 | ||
|
|
39f95f5614 | ||
|
|
5f9c82d514 | ||
|
|
fa713ec17b | ||
|
|
221345a013 | ||
|
|
ed949a1973 | ||
|
|
881e43a03c | ||
|
|
c2b1182879 | ||
|
|
99a8ec6e24 | ||
|
|
79a606bd95 | ||
|
|
df7417d127 | ||
|
|
78773890f6 | ||
|
|
eda7492604 | ||
|
|
c1f8dd4a33 |
No files matched your search
@@ -1,6 +1,68 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2020, PHP 7.4.13
|
||||
07 Jan 2021, PHP 7.4.14
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74558 (Can't rebind closure returned by Closure::fromCallable()).
|
||||
(cmb)
|
||||
. Fixed bug #80345 (PHPIZE configuration has outdated PHP_RELEASE_VERSION).
|
||||
(cmb)
|
||||
. Fixed bug #72964 (White space not unfolded for CC/Bcc headers). (cmb)
|
||||
. Fixed bug #80362 (Running dtrace scripts can cause php to crash).
|
||||
(al at coralnet dot name)
|
||||
. Fixed bug #80393 (Build of PHP extension fails due to configuration gap
|
||||
with libtool). (kir dot morozov at gmail dot com)
|
||||
. Fixed bug #80402 (configure filtering out -lpthread). (Nikita)
|
||||
. Fixed bug #77069 (stream filter loses final block of data). (cmb)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #77961 (finfo_open crafted magic parsing SIGABRT). (cmb)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #69625 (FPM returns 200 status on request without
|
||||
SCRIPT_FILENAME env). (Jakub Zelenka)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #80425 (MessageFormatAdapter::getArgTypeList redefined). (Nikita)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #80368 (OpenSSL extension fails to build against LibreSSL due to
|
||||
lack of OCB support). (Nikita)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #73809 (Phar Zip parse crash - mmap fail). (cmb)
|
||||
. Fixed bug #75102 (`PharData` says invalid checksum for valid tar). (cmb)
|
||||
. Fixed bug #77322 (PharData::addEmptyDir('/') Possible integer overflow).
|
||||
(cmb)
|
||||
|
||||
- PDO MySQL:
|
||||
. Fixed bug #80458 (PDOStatement::fetchAll() throws for upsert queries).
|
||||
(Kamil Tekiela)
|
||||
. Fixed bug #63185 (nextRowset() ignores MySQL errors with native prepared
|
||||
statements). (Nikita)
|
||||
. Fixed bug #78152 (PDO::exec() - Bad error handling with multiple commands).
|
||||
(Nikita)
|
||||
. Fixed bug #70066 (Unexpected "Cannot execute queries while other unbuffered
|
||||
queries"). (Nikita)
|
||||
. Fixed bug #71145 (Multiple statements in init command triggers unbuffered
|
||||
query error). (Nikita)
|
||||
. Fixed bug #76815 (PDOStatement cannot be GCed/closeCursor-ed when a
|
||||
PROCEDURE resultset SIGNAL). (Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #77423 (FILTER_VALIDATE_URL accepts URLs with invalid userinfo).
|
||||
(CVE-2020-7071) (cmb)
|
||||
. Fixed bug #80366 (Return Value of zend_fstat() not Checked). (sagpant, cmb)
|
||||
. Fixed bug #80411 (References to null-serialized object break serialize()).
|
||||
(Nikita)
|
||||
|
||||
- Tidy:
|
||||
. Fixed bug #77594 (ob_tidyhandler is never reset). (cmb)
|
||||
|
||||
- Zlib:
|
||||
. Fixed #48725 (Support for flushing in zlib stream). (cmb)
|
||||
|
||||
26 Nov 2020, PHP 7.4.13
|
||||
|
||||
- Core:
|
||||
. Fixed bug #80280 (ADD_EXTENSION_DEP() fails for ext/standard and ext/date).
|
||||
|
||||
@@ -7,4 +7,4 @@ $x = (new ReflectionFunction("substr"))->getClosure();
|
||||
$x->call(new a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
|
||||
Warning: Cannot rebind scope of closure created from function in %s on line %d
|
||||
@@ -18,5 +18,5 @@ var_dump($c);
|
||||
Warning: Cannot bind method SplDoublyLinkedList::count() to object of class cls in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
|
||||
Warning: Cannot rebind scope of closure created from method in %s on line %d
|
||||
NULL
|
||||
+12
-12
@@ -118,10 +118,10 @@ bindTo(new Cls, null):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, Cls::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from function
|
||||
|
||||
bindTo(null, Cls::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from function
|
||||
|
||||
bindTo(null, stdClass::class):
|
||||
Cannot bind closure to scope of internal class stdClass
|
||||
@@ -139,10 +139,10 @@ bindTo(new Cls, null):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, Cls::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from function
|
||||
|
||||
bindTo(null, Cls::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from function
|
||||
|
||||
bindTo(null, stdClass::class):
|
||||
Cannot bind closure to scope of internal class stdClass
|
||||
@@ -163,13 +163,13 @@ bindTo(new Cls, Cls::class):
|
||||
Cannot bind an instance to a static closure
|
||||
|
||||
bindTo(null, null):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from method
|
||||
|
||||
bindTo(null, ClsChild::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from method
|
||||
|
||||
bindTo(null, ClsUnrelated::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from method
|
||||
|
||||
(new Cls)->method()
|
||||
-------------------
|
||||
@@ -189,13 +189,13 @@ bindTo(new ClsUnrelated, Cls::class):
|
||||
Cannot bind method Cls::method() to object of class ClsUnrelated
|
||||
|
||||
bindTo(new Cls, null):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from method
|
||||
|
||||
bindTo(new Cls, ClsUnrelated::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from method
|
||||
|
||||
bindTo(new Cls, ClsChild::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from method
|
||||
|
||||
(new SplDoublyLinkedList)->count()
|
||||
----------------------------------
|
||||
@@ -216,10 +216,10 @@ bindTo(null, SplDoublyLinkedList::class):
|
||||
Cannot unbind $this of internal method
|
||||
|
||||
bindTo(new SplDoublyLinkedList, null):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from method
|
||||
|
||||
bindTo(new SplDoublyLinkedList, ClsUnrelated::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
Cannot rebind scope of closure created from method
|
||||
|
||||
(function() {})()
|
||||
-----------------
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
GC on running generator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
yield;
|
||||
// Trigger GC while $v is being reassigned.
|
||||
$ary = [new stdClass, new stdClass, new stdClass];
|
||||
$ary[0]->foo = $ary;
|
||||
foreach ($ary as &$v) { }
|
||||
}
|
||||
|
||||
for ($i = 0; $i < 10000; $i++) {
|
||||
// Make sure gen is registered as a GC root.
|
||||
$gen = gen();
|
||||
$gen2 = $gen;
|
||||
unset($gen);
|
||||
foreach ($gen2 as $v) {}
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Missing live range if part of phi
|
||||
--FILE--
|
||||
<?php
|
||||
function doThrow() {
|
||||
throw new Exception("Test");
|
||||
}
|
||||
function test($k) {
|
||||
// The 0 gives the QM_ASSIGN a non-refcounted type.
|
||||
$res[$k ? $k : 0] = doThrow();
|
||||
}
|
||||
try {
|
||||
test(new stdClass);
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Test
|
||||
+3
-1
@@ -1309,7 +1309,9 @@ static ZEND_COLD void zend_error_va_list(
|
||||
#ifdef HAVE_DTRACE
|
||||
if (DTRACE_ERROR_ENABLED()) {
|
||||
char *dtrace_error_buffer;
|
||||
zend_vspprintf(&dtrace_error_buffer, 0, format, args);
|
||||
va_copy(usr_copy, args);
|
||||
zend_vspprintf(&dtrace_error_buffer, 0, format, usr_copy);
|
||||
va_end(usr_copy);
|
||||
DTRACE_ERROR(dtrace_error_buffer, (char *)error_filename, error_lineno);
|
||||
efree(dtrace_error_buffer);
|
||||
}
|
||||
|
||||
@@ -104,7 +104,11 @@ static zend_bool zend_valid_closure_binding(
|
||||
}
|
||||
|
||||
if (is_fake_closure && scope != func->common.scope) {
|
||||
zend_error(E_WARNING, "Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()");
|
||||
if (func->common.scope == NULL) {
|
||||
zend_error(E_WARNING, "Cannot rebind scope of closure created from function");
|
||||
} else {
|
||||
zend_error(E_WARNING, "Cannot rebind scope of closure created from method");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,44 @@ static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
/* Function based on compiler-rt implementation. */
|
||||
static unsigned get_xcr0_eax() {
|
||||
# if defined(__GNUC__) || defined(__clang__)
|
||||
// Check xgetbv; this uses a .byte sequence instead of the instruction
|
||||
// directly because older assemblers do not include support for xgetbv and
|
||||
// there is no easy way to conditionally compile based on the assembler used.
|
||||
unsigned eax, edx;
|
||||
__asm__(".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c"(0));
|
||||
return eax;
|
||||
# elif defined(ZEND_WIN32) && defined(_XCR_XFEATURE_ENABLED_MASK)
|
||||
return _xgetbv(_XCR_XFEATURE_ENABLED_MASK);
|
||||
# else
|
||||
return 0;
|
||||
# endif
|
||||
}
|
||||
|
||||
static zend_bool is_avx_supported() {
|
||||
if (!(cpuinfo.ecx & ZEND_CPU_FEATURE_AVX)) {
|
||||
/* No support for AVX */
|
||||
return 0;
|
||||
}
|
||||
if (!(cpuinfo.ecx & ZEND_CPU_FEATURE_OSXSAVE)) {
|
||||
/* The operating system does not support XSAVE. */
|
||||
return 0;
|
||||
}
|
||||
if ((get_xcr0_eax() & 0x6) != 0x6) {
|
||||
/* XCR0 SSE and AVX bits must be set. */
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
static zend_bool is_avx_supported() {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
void zend_cpu_startup(void)
|
||||
{
|
||||
if (!cpuinfo.initialized) {
|
||||
@@ -95,6 +133,11 @@ void zend_cpu_startup(void)
|
||||
} else {
|
||||
cpuinfo.ebx = 0;
|
||||
}
|
||||
|
||||
if (!is_avx_supported()) {
|
||||
cpuinfo.edx &= ~ZEND_CPU_FEATURE_AVX;
|
||||
cpuinfo.ebx &= ~(ZEND_CPU_FEATURE_AVX2 & ~ZEND_CPU_EBX_MASK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1294,7 +1294,7 @@ static void zend_set_timeout_ex(zend_long seconds, int reset_signals) /* {{{ */
|
||||
t_r.it_value.tv_sec = seconds;
|
||||
t_r.it_value.tv_usec = t_r.it_interval.tv_sec = t_r.it_interval.tv_usec = 0;
|
||||
|
||||
# ifdef __CYGWIN__
|
||||
# if defined(__CYGWIN__) || defined(__PASE__)
|
||||
setitimer(ITIMER_REAL, &t_r, NULL);
|
||||
}
|
||||
signo = SIGALRM;
|
||||
@@ -1356,7 +1356,7 @@ void zend_unset_timeout(void) /* {{{ */
|
||||
|
||||
no_timeout.it_value.tv_sec = no_timeout.it_value.tv_usec = no_timeout.it_interval.tv_sec = no_timeout.it_interval.tv_usec = 0;
|
||||
|
||||
# ifdef __CYGWIN__
|
||||
# if defined(__CYGWIN__) || defined(__PASE__)
|
||||
setitimer(ITIMER_REAL, &no_timeout, NULL);
|
||||
# else
|
||||
setitimer(ITIMER_PROF, &no_timeout, NULL);
|
||||
|
||||
@@ -340,6 +340,16 @@ static HashTable *zend_generator_get_gc(zval *object, zval **table, int *n) /* {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (generator->flags & ZEND_GENERATOR_CURRENTLY_RUNNING) {
|
||||
/* If the generator is currently running, we certainly won't be able to GC any values it
|
||||
* holds on to. The execute_data state might be inconsistent during execution (e.g. because
|
||||
* GC has been triggered in the middle of a variable reassignment), so we should not try
|
||||
* to inspect it here. */
|
||||
*table = NULL;
|
||||
*n = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
op_array = &EX(func)->op_array;
|
||||
gc_buffer_size = calc_gc_buffer_size(generator);
|
||||
if (generator->gc_buffer_size < gc_buffer_size) {
|
||||
|
||||
+2
-1
@@ -62,7 +62,8 @@ ZEND_API zend_signal_globals_t zend_signal_globals;
|
||||
static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context);
|
||||
static int zend_signal_register(int signo, void (*handler)(int, siginfo_t*, void*));
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
#if defined(__CYGWIN__) || defined(__PASE__)
|
||||
/* Matches zend_excute_API.c; these platforms don't support ITIMER_PROF. */
|
||||
#define TIMEOUT_SIG SIGALRM
|
||||
#else
|
||||
#define TIMEOUT_SIG SIGPROF
|
||||
|
||||
@@ -32,10 +32,13 @@ jobs:
|
||||
runTestsParameters: >-
|
||||
${{ parameters.runTestsParameters }}
|
||||
-d zend_extension=opcache.so
|
||||
- script: bash <(curl -s https://codecov.io/bash)
|
||||
displayName: 'Upload ${{ parameters.configurationName }} Test Coverage to Codecov.io'
|
||||
condition: or(succeeded(), failed())
|
||||
- script: |
|
||||
make gcovr-xml
|
||||
mv gcovr.xml coverage.xml
|
||||
displayName: 'Generate ${{ parameters.configurationName }} Test Coverage'
|
||||
displayName: 'Generate ${{ parameters.configurationName }} Test Coverage Cobertura XML Report'
|
||||
condition: or(succeeded(), failed())
|
||||
- task: PublishCodeCoverageResults@1
|
||||
inputs:
|
||||
|
||||
Vendored
+3
-3
@@ -340,7 +340,7 @@ AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
|
||||
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
|
||||
10.[[012]]*)
|
||||
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
|
||||
10.*)
|
||||
*)
|
||||
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
|
||||
esac
|
||||
;;
|
||||
@@ -1521,7 +1521,7 @@ darwin* | rhapsody*)
|
||||
shlibpath_var=DYLD_LIBRARY_PATH
|
||||
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
|
||||
ifelse([$1], [],[
|
||||
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
|
||||
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
|
||||
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
|
||||
;;
|
||||
|
||||
@@ -5799,7 +5799,7 @@ _LT_EOF
|
||||
10.[[012]])
|
||||
_LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
|
||||
;;
|
||||
10.*)
|
||||
*)
|
||||
_LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
|
||||
;;
|
||||
esac
|
||||
|
||||
+7
-1
@@ -498,7 +498,7 @@ dnl Internal, don't use.
|
||||
dnl
|
||||
AC_DEFUN([_PHP_ADD_LIBRARY_SKELETON],[
|
||||
case $1 in
|
||||
c|c_r|pthread*[)] ;;
|
||||
c|c_r[)] ;;
|
||||
*[)] ifelse($3,,[
|
||||
_PHP_X_ADD_LIBRARY($1,$2,$5)
|
||||
],[
|
||||
@@ -1783,6 +1783,9 @@ AC_DEFUN([PHP_PROG_BISON], [
|
||||
AC_MSG_CHECKING([for bison version])
|
||||
|
||||
php_bison_version=$($YACC --version 2> /dev/null | grep 'GNU Bison' | cut -d ' ' -f 4 | tr -d a-z)
|
||||
if test -z "$php_bison_version"; then
|
||||
php_bison_version=0.0.0
|
||||
fi
|
||||
ac_IFS=$IFS; IFS="."
|
||||
set $php_bison_version
|
||||
IFS=$ac_IFS
|
||||
@@ -1846,6 +1849,9 @@ AC_DEFUN([PHP_PROG_RE2C],[
|
||||
AC_MSG_CHECKING([for re2c version])
|
||||
|
||||
php_re2c_version=$($RE2C --version | cut -d ' ' -f 2 2>/dev/null)
|
||||
if test -z "$php_re2c_version"; then
|
||||
php_re2c_version=0.0.0
|
||||
fi
|
||||
ac_IFS=$IFS; IFS="."
|
||||
set $php_re2c_version
|
||||
IFS=$ac_IFS
|
||||
|
||||
+38
-31
@@ -1,6 +1,6 @@
|
||||
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
--- libmagic.orig/apprentice.c 2019-02-20 03:35:27.000000000 +0100
|
||||
+++ libmagic/apprentice.c 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/apprentice.c 2020-11-19 11:50:32.412674100 +0100
|
||||
@@ -29,6 +29,8 @@
|
||||
* apprentice - make one pass through /etc/magic, learning its secrets.
|
||||
*/
|
||||
@@ -974,7 +974,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
}
|
||||
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
--- libmagic.orig/ascmagic.c 2019-05-07 04:27:11.000000000 +0200
|
||||
+++ libmagic/ascmagic.c 2020-02-26 23:18:22.605400700 +0100
|
||||
+++ libmagic/ascmagic.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -96,7 +96,7 @@
|
||||
rv = file_ascmagic_with_encoding(ms, &bb,
|
||||
ubuf, ulen, code, type, text);
|
||||
@@ -1005,7 +1005,7 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
}
|
||||
diff -u libmagic.orig/buffer.c libmagic/buffer.c
|
||||
--- libmagic.orig/buffer.c 2019-05-07 04:27:11.000000000 +0200
|
||||
+++ libmagic/buffer.c 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/buffer.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -31,19 +31,23 @@
|
||||
#endif /* lint */
|
||||
|
||||
@@ -1062,7 +1062,7 @@ diff -u libmagic.orig/buffer.c libmagic/buffer.c
|
||||
|
||||
diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
--- libmagic.orig/cdf.c 2019-02-20 03:35:27.000000000 +0100
|
||||
+++ libmagic/cdf.c 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/cdf.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -43,7 +43,17 @@
|
||||
#include <err.h>
|
||||
#endif
|
||||
@@ -1341,7 +1341,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
#endif
|
||||
diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
--- libmagic.orig/cdf.h 2019-02-20 02:24:19.000000000 +0100
|
||||
+++ libmagic/cdf.h 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/cdf.h 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -35,10 +35,10 @@
|
||||
#ifndef _H_CDF_
|
||||
#define _H_CDF_
|
||||
@@ -1366,7 +1366,7 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
#define CDF_SECID_FREE -1
|
||||
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
--- libmagic.orig/cdf_time.c 2019-03-12 21:43:05.000000000 +0100
|
||||
+++ libmagic/cdf_time.c 2020-02-26 23:18:22.611402900 +0100
|
||||
+++ libmagic/cdf_time.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -23,6 +23,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -1395,7 +1395,7 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
(void)snprintf(buf, 26, "*Bad* %#16.16" INT64_T_FORMAT "x\n",
|
||||
diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
--- libmagic.orig/compress.c 2019-05-07 04:27:11.000000000 +0200
|
||||
+++ libmagic/compress.c 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/compress.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -45,13 +45,11 @@
|
||||
#endif
|
||||
#include <string.h>
|
||||
@@ -1545,7 +1545,7 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
+#endif
|
||||
diff -u libmagic.orig/der.c libmagic/der.c
|
||||
--- libmagic.orig/der.c 2019-02-20 03:35:27.000000000 +0100
|
||||
+++ libmagic/der.c 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/der.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -51,7 +51,9 @@
|
||||
#include "magic.h"
|
||||
#include "der.h"
|
||||
@@ -1575,7 +1575,7 @@ diff -u libmagic.orig/der.c libmagic/der.c
|
||||
snprintf(buf + z, blen - z, "%.2x", d[i]);
|
||||
diff -u libmagic.orig/elfclass.h libmagic/elfclass.h
|
||||
--- libmagic.orig/elfclass.h 2019-02-20 02:30:19.000000000 +0100
|
||||
+++ libmagic/elfclass.h 2020-02-26 23:18:22.613401700 +0100
|
||||
+++ libmagic/elfclass.h 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -41,7 +41,7 @@
|
||||
return toomany(ms, "program headers", phnum);
|
||||
flags |= FLAGS_IS_CORE;
|
||||
@@ -1605,7 +1605,7 @@ diff -u libmagic.orig/elfclass.h libmagic/elfclass.h
|
||||
CAST(int, elf_getu16(swap, elfhdr.e_shstrndx)),
|
||||
diff -u libmagic.orig/encoding.c libmagic/encoding.c
|
||||
--- libmagic.orig/encoding.c 2019-04-15 18:48:41.000000000 +0200
|
||||
+++ libmagic/encoding.c 2020-02-26 23:18:22.614402300 +0100
|
||||
+++ libmagic/encoding.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -89,13 +89,13 @@
|
||||
*code_mime = "binary";
|
||||
|
||||
@@ -1636,7 +1636,7 @@ diff -u libmagic.orig/encoding.c libmagic/encoding.c
|
||||
}
|
||||
diff -u libmagic.orig/file.h libmagic/file.h
|
||||
--- libmagic.orig/file.h 2019-05-07 04:27:11.000000000 +0200
|
||||
+++ libmagic/file.h 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/file.h 2020-11-23 17:11:36.234964700 +0100
|
||||
@@ -33,18 +33,9 @@
|
||||
#ifndef __file_h__
|
||||
#define __file_h__
|
||||
@@ -1658,7 +1658,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
#ifdef _WIN64
|
||||
#define SIZE_T_FORMAT "I64"
|
||||
#else
|
||||
@@ -57,19 +48,34 @@
|
||||
@@ -57,32 +48,49 @@
|
||||
#define INT64_T_FORMAT "ll"
|
||||
#define INTMAX_T_FORMAT "j"
|
||||
#endif
|
||||
@@ -1698,7 +1698,14 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
/* Do this here and now, because struct stat gets re-defined on solaris */
|
||||
@@ -82,7 +88,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
+#define abort() zend_error_noreturn(E_ERROR, "fatal libmagic error")
|
||||
+
|
||||
#define ENABLE_CONDITIONALS
|
||||
|
||||
#ifndef MAGIC
|
||||
#define MAGIC "/etc/magic"
|
||||
#endif
|
||||
|
||||
@@ -1707,7 +1714,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
#define PATHSEP ';'
|
||||
#else
|
||||
#define PATHSEP ':'
|
||||
@@ -116,12 +122,6 @@
|
||||
@@ -116,12 +124,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1720,7 +1727,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
@@ -150,10 +150,10 @@
|
||||
@@ -150,10 +152,10 @@
|
||||
|
||||
struct buffer {
|
||||
int fd;
|
||||
@@ -1733,7 +1740,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
void *ebuf;
|
||||
size_t elen;
|
||||
};
|
||||
@@ -243,7 +243,7 @@
|
||||
@@ -243,7 +245,7 @@
|
||||
#define FILE_DER 48
|
||||
#define FILE_NAMES_SIZE 49 /* size of array to contain all names */
|
||||
|
||||
@@ -1742,7 +1749,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
((t) == FILE_STRING || \
|
||||
(t) == FILE_PSTRING || \
|
||||
(t) == FILE_BESTRING16 || \
|
||||
@@ -447,28 +447,23 @@
|
||||
@@ -447,28 +449,23 @@
|
||||
/* Type for Unicode characters */
|
||||
typedef unsigned long unichar;
|
||||
|
||||
@@ -1776,7 +1783,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
protected int file_zmagic(struct magic_set *, const struct buffer *,
|
||||
const char *);
|
||||
#endif
|
||||
@@ -491,13 +486,9 @@
|
||||
@@ -491,13 +488,9 @@
|
||||
protected void file_badread(struct magic_set *);
|
||||
protected void file_badseek(struct magic_set *);
|
||||
protected void file_oomem(struct magic_set *, size_t);
|
||||
@@ -1793,7 +1800,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
protected void file_showstr(FILE *, const char *, size_t);
|
||||
protected size_t file_mbswidth(const char *);
|
||||
protected const char *file_getbuffer(struct magic_set *);
|
||||
@@ -513,34 +504,13 @@
|
||||
@@ -513,34 +506,13 @@
|
||||
size_t);
|
||||
#endif /* __EMX__ */
|
||||
|
||||
@@ -1831,7 +1838,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
|
||||
typedef struct {
|
||||
char *buf;
|
||||
@@ -550,28 +520,13 @@
|
||||
@@ -550,28 +522,13 @@
|
||||
protected file_pushbuf_t *file_push_buffer(struct magic_set *);
|
||||
protected char *file_pop_buffer(struct magic_set *, file_pushbuf_t *);
|
||||
|
||||
@@ -1862,7 +1869,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
size_t strlcat(char *, const char *, size_t);
|
||||
#endif
|
||||
#ifndef HAVE_STRCASESTR
|
||||
@@ -587,39 +542,6 @@
|
||||
@@ -587,39 +544,6 @@
|
||||
#ifndef HAVE_ASCTIME_R
|
||||
char *asctime_r(const struct tm *, char *);
|
||||
#endif
|
||||
@@ -1902,7 +1909,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
|
||||
#if defined(HAVE_MMAP) && defined(HAVE_SYS_MMAN_H) && !defined(QUICK)
|
||||
#define QUICK
|
||||
@@ -645,6 +567,18 @@
|
||||
@@ -645,6 +569,18 @@
|
||||
#else
|
||||
#define FILE_RCSID(id)
|
||||
#endif
|
||||
@@ -1923,7 +1930,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
#endif
|
||||
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
--- libmagic.orig/fsmagic.c 2019-05-07 04:26:48.000000000 +0200
|
||||
+++ libmagic/fsmagic.c 2020-02-26 23:18:22.616403500 +0100
|
||||
+++ libmagic/fsmagic.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -66,26 +66,10 @@
|
||||
# define minor(dev) ((dev) & 0xff)
|
||||
#endif
|
||||
@@ -2216,7 +2223,7 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
case S_IFSOCK:
|
||||
diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
--- libmagic.orig/funcs.c 2019-05-07 04:27:11.000000000 +0200
|
||||
+++ libmagic/funcs.c 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/funcs.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -31,7 +31,6 @@
|
||||
#endif /* lint */
|
||||
|
||||
@@ -2572,7 +2579,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
|
||||
diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
--- libmagic.orig/magic.c 2019-05-07 04:27:11.000000000 +0200
|
||||
+++ libmagic/magic.c 2020-02-26 23:18:22.621402800 +0100
|
||||
+++ libmagic/magic.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -25,11 +25,6 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
@@ -3036,8 +3043,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
public const char *
|
||||
magic_error(struct magic_set *ms)
|
||||
diff -u libmagic.orig/magic.h libmagic/magic.h
|
||||
--- libmagic.orig/magic.h 2020-03-02 15:24:27.253951700 +0100
|
||||
+++ libmagic/magic.h 2020-02-26 23:18:22.622402300 +0100
|
||||
--- libmagic.orig/magic.h 2020-11-23 17:12:12.776465800 +0100
|
||||
+++ libmagic/magic.h 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -124,6 +124,7 @@
|
||||
|
||||
const char *magic_getpath(const char *, int);
|
||||
@@ -3048,7 +3055,7 @@ diff -u libmagic.orig/magic.h libmagic/magic.h
|
||||
|
||||
diff -u libmagic.orig/print.c libmagic/print.c
|
||||
--- libmagic.orig/print.c 2019-03-12 21:43:05.000000000 +0100
|
||||
+++ libmagic/print.c 2020-02-26 23:18:22.625401800 +0100
|
||||
+++ libmagic/print.c 2020-09-07 00:42:14.447562400 +0200
|
||||
@@ -28,6 +28,7 @@
|
||||
/*
|
||||
* print.c - debugging printout routines
|
||||
@@ -3122,7 +3129,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
|
||||
goto out;
|
||||
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
--- libmagic.orig/readcdf.c 2019-03-12 21:43:05.000000000 +0100
|
||||
+++ libmagic/readcdf.c 2020-02-27 11:45:38.445854000 +0100
|
||||
+++ libmagic/readcdf.c 2020-09-07 00:42:14.463191200 +0200
|
||||
@@ -31,7 +31,11 @@
|
||||
|
||||
#include <assert.h>
|
||||
@@ -3241,7 +3248,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
if (i != -1)
|
||||
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
--- libmagic.orig/softmagic.c 2019-05-17 04:24:59.000000000 +0200
|
||||
+++ libmagic/softmagic.c 2020-03-02 15:23:10.176763300 +0100
|
||||
+++ libmagic/softmagic.c 2020-09-07 00:42:14.463191200 +0200
|
||||
@@ -43,6 +43,10 @@
|
||||
#include <time.h>
|
||||
#include "der.h"
|
||||
@@ -3608,7 +3615,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
case FILE_INDIRECT:
|
||||
diff -u libmagic.orig/strcasestr.c libmagic/strcasestr.c
|
||||
--- libmagic.orig/strcasestr.c 2014-09-11 17:05:33.000000000 +0200
|
||||
+++ libmagic/strcasestr.c 2019-11-29 08:49:38.434136600 +0100
|
||||
+++ libmagic/strcasestr.c 2020-08-05 15:01:55.644887300 +0200
|
||||
@@ -39,6 +39,8 @@
|
||||
|
||||
#include "file.h"
|
||||
|
||||
@@ -82,6 +82,8 @@
|
||||
#include <sys/stat.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#define abort() zend_error_noreturn(E_ERROR, "fatal libmagic error")
|
||||
|
||||
#define ENABLE_CONDITIONALS
|
||||
|
||||
#ifndef MAGIC
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
0 string 1
|
||||
>1 regex \^[0-9:,\ ]*-->[0-9:,\ ]* SubRip File
|
||||
!:mime text/x-srt
|
||||
|
||||
0 lelong 0xc3cbc6c5 RISC OS Chunk data
|
||||
>12 string OBJ_ \b, AOF object
|
||||
>12 string LIB_ \b, ALF library
|
||||
|
||||
0 name mach-o \b [
|
||||
>0 use mach-o-cpu \b
|
||||
>(8.L) indirect 8 \b:
|
||||
>0 belong x \b]
|
||||
|
||||
0 belong 0xcafed00d JAR compressed with pack200,
|
||||
>5 byte x version %d.
|
||||
>4 byte x \b%d
|
||||
!:mime application/x-java-pack200
|
||||
|
||||
# Objective-C
|
||||
0 regex \^#import Objective-C source text
|
||||
!:strength + 25
|
||||
!:mime text/x-objective-c
|
||||
|
||||
0 string \x20\x20\x20\x20\x20\x20\x20\x20-:\x20\x20\x20\ 0:Source:
|
||||
>&0 search/128 \x20\x20\x20\x20\x20\x20\x20\x20-:\x20\x20\x20\ 0:Graph:
|
||||
>>&0 search/128 \x20\x20\x20\x20\x20\x20\x20\x20-:\x20\x20\x20\ 0:Data: GCOV coverage report
|
||||
|
||||
0 name certinfo
|
||||
>0 der seq
|
||||
>>&0 der set
|
||||
>>>&0 der seq
|
||||
>>>>&0 der obj_id3=550406
|
||||
>>>>&0 der prt_str=x \b, countryName=%s
|
||||
>>&0 der set
|
||||
>>>&0 der seq
|
||||
>>>>&0 der obj_id3=550408
|
||||
>>>>&0 der utf8_str=x \b, stateOrProvinceName=%s
|
||||
>>&0 der set
|
||||
>>>&0 der seq
|
||||
>>>>&0 der obj_id3=55040a
|
||||
>>>>&0 der utf8_str=x \b, organizationName=%s
|
||||
>>&0 der set
|
||||
>>>&0 der seq
|
||||
>>>>&0 der obj_id3=550403
|
||||
>>>>&0 der utf8_str=x \b, commonName=%s
|
||||
>>&0 der seq
|
||||
|
||||
0 search/1 FONT ASCII vfont text
|
||||
0 short 0436 Berkeley vfont data
|
||||
0 short 017001 byte-swapped Berkeley vfont data
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #77961 (finfo_open crafted magic parsing SIGABRT)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('fileinfo')) die('skip fileinfo extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
finfo_open(FILEINFO_NONE, __DIR__ . '/bug77961.magic');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: finfo_open(): Warning: Expected numeric type got `indirect' in %s on line %d
|
||||
|
||||
Fatal error: fatal libmagic error in %s on line %d
|
||||
@@ -46,25 +46,26 @@ extern "C" {
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
/**
|
||||
* This class isolates our access to private internal methods of
|
||||
* MessageFormat. It is never instantiated; it exists only for C++
|
||||
* access management.
|
||||
* ICU declares MessageFormatAdapter as a friend class of MessageFormat,
|
||||
* to use as a backdoor for accessing private MessageFormat members.
|
||||
* We use it for the same purpose here. Prefix the methods with php to
|
||||
* avoid clashes with any definitions in ICU.
|
||||
*/
|
||||
class MessageFormatAdapter {
|
||||
public:
|
||||
static const Formattable::Type* getArgTypeList(const MessageFormat& m,
|
||||
static const Formattable::Type* phpGetArgTypeList(const MessageFormat& m,
|
||||
int32_t& count);
|
||||
static const MessagePattern getMessagePattern(MessageFormat* m);
|
||||
static const MessagePattern phpGetMessagePattern(MessageFormat* m);
|
||||
};
|
||||
|
||||
const Formattable::Type*
|
||||
MessageFormatAdapter::getArgTypeList(const MessageFormat& m,
|
||||
MessageFormatAdapter::phpGetArgTypeList(const MessageFormat& m,
|
||||
int32_t& count) {
|
||||
return m.getArgTypeList(count);
|
||||
}
|
||||
|
||||
const MessagePattern
|
||||
MessageFormatAdapter::getMessagePattern(MessageFormat* m) {
|
||||
MessageFormatAdapter::phpGetMessagePattern(MessageFormat* m) {
|
||||
return m->msgPattern;
|
||||
}
|
||||
U_NAMESPACE_END
|
||||
@@ -80,7 +81,7 @@ using icu::FieldPosition;
|
||||
U_CFUNC int32_t umsg_format_arg_count(UMessageFormat *fmt)
|
||||
{
|
||||
int32_t fmt_count = 0;
|
||||
MessageFormatAdapter::getArgTypeList(*(const MessageFormat*)fmt, fmt_count);
|
||||
MessageFormatAdapter::phpGetArgTypeList(*(const MessageFormat*)fmt, fmt_count);
|
||||
return fmt_count;
|
||||
}
|
||||
|
||||
@@ -103,7 +104,7 @@ static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo,
|
||||
return mfo->mf_data.arg_types;
|
||||
}
|
||||
|
||||
const Formattable::Type *types = MessageFormatAdapter::getArgTypeList(
|
||||
const Formattable::Type *types = MessageFormatAdapter::phpGetArgTypeList(
|
||||
*(MessageFormat*)mfo->mf_data.umsgf, parts_count);
|
||||
|
||||
/* Hash table will store Formattable::Type objects directly,
|
||||
@@ -288,7 +289,7 @@ static HashTable *umsg_get_types(MessageFormatter_object *mfo,
|
||||
{
|
||||
MessageFormat *mf = (MessageFormat *)mfo->mf_data.umsgf;
|
||||
|
||||
const MessagePattern mp = MessageFormatAdapter::getMessagePattern(mf);
|
||||
const MessagePattern mp = MessageFormatAdapter::phpGetMessagePattern(mf);
|
||||
|
||||
return umsg_parse_format(mfo, mp, err);
|
||||
}
|
||||
|
||||
+17
-30
@@ -1041,51 +1041,38 @@ PHP_FUNCTION(mysqli_stmt_construct)
|
||||
zval *mysql_link;
|
||||
MY_STMT *stmt;
|
||||
MYSQLI_RESOURCE *mysqli_resource;
|
||||
char *statement;
|
||||
char *statement = NULL;
|
||||
size_t statement_len;
|
||||
|
||||
switch (ZEND_NUM_ARGS())
|
||||
{
|
||||
case 1: /* mysql_stmt_init */
|
||||
if (zend_parse_parameters(1, "O", &mysql_link, mysqli_link_class_entry)==FAILURE) {
|
||||
return;
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
|
||||
|
||||
stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT));
|
||||
|
||||
stmt->stmt = mysql_stmt_init(mysql->mysql);
|
||||
break;
|
||||
case 2:
|
||||
if (zend_parse_parameters(2, "Os", &mysql_link, mysqli_link_class_entry, &statement, &statement_len)==FAILURE) {
|
||||
return;
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
|
||||
|
||||
stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT));
|
||||
|
||||
if ((stmt->stmt = mysql_stmt_init(mysql->mysql))) {
|
||||
mysql_stmt_prepare(stmt->stmt, (char *)statement, statement_len);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
break;
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|s!", &mysql_link, mysqli_link_class_entry, &statement, &statement_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
|
||||
|
||||
if (!stmt->stmt) {
|
||||
stmt = (MY_STMT *) ecalloc(1, sizeof(MY_STMT));
|
||||
|
||||
if (!(stmt->stmt = mysql_stmt_init(mysql->mysql))) {
|
||||
efree(stmt);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
#ifndef MYSQLI_USE_MYSQLND
|
||||
ZVAL_COPY(&stmt->link_handle, mysql_link);
|
||||
#endif
|
||||
|
||||
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
|
||||
mysqli_resource->ptr = (void *)stmt;
|
||||
mysqli_resource->status = (ZEND_NUM_ARGS() == 1) ? MYSQLI_STATUS_INITIALIZED : MYSQLI_STATUS_VALID;
|
||||
mysqli_resource->status = MYSQLI_STATUS_INITIALIZED;
|
||||
|
||||
MYSQLI_REGISTER_RESOURCE_EX(mysqli_resource, getThis());
|
||||
|
||||
if (statement) {
|
||||
if(mysql_stmt_prepare(stmt->stmt, statement, statement_len)) {
|
||||
MYSQLI_REPORT_STMT_ERROR(stmt->stmt);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
mysqli_resource->status = MYSQLI_STATUS_VALID;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+10
-2
@@ -1608,7 +1608,11 @@ PHP_FUNCTION(mysqli_next_result) {
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
|
||||
|
||||
RETURN_BOOL(!mysql_next_result(mysql->mysql));
|
||||
if (mysql_next_result(mysql->mysql)) {
|
||||
MYSQLI_REPORT_MYSQL_ERROR(mysql->mysql);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1640,7 +1644,11 @@ PHP_FUNCTION(mysqli_stmt_next_result) {
|
||||
}
|
||||
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
|
||||
|
||||
RETURN_BOOL(!mysql_stmt_next_result(stmt->stmt));
|
||||
if (mysql_stmt_next_result(stmt->stmt)) {
|
||||
MYSQLI_REPORT_STMT_ERROR(stmt->stmt);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
+38
-38
@@ -8,55 +8,55 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
$test = "";
|
||||
$test = "";
|
||||
|
||||
/*** test mysqli_connect localhost:port ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, "", $port, $socket);
|
||||
$test .= ($link) ? "1" : "0";
|
||||
mysqli_close($link);
|
||||
/*** test mysqli_connect localhost:port ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, "", $port, $socket);
|
||||
$test .= ($link) ? "1" : "0";
|
||||
mysqli_close($link);
|
||||
|
||||
/*** test mysqli_real_connect ***/
|
||||
$link = mysqli_init();
|
||||
$test.= (my_mysqli_real_connect($link, $host, $user, $passwd, "", $port, $socket) )
|
||||
? "1" : "0";
|
||||
mysqli_close($link);
|
||||
/*** test mysqli_real_connect ***/
|
||||
$link = mysqli_init();
|
||||
$test.= (my_mysqli_real_connect($link, $host, $user, $passwd, "", $port, $socket) )
|
||||
? "1" : "0";
|
||||
mysqli_close($link);
|
||||
|
||||
/*** test mysqli_real_connect with db ***/
|
||||
$link = mysqli_init();
|
||||
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
|
||||
? "1" : "0";
|
||||
mysqli_close($link);
|
||||
/*** test mysqli_real_connect with db ***/
|
||||
$link = mysqli_init();
|
||||
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
|
||||
? "1" : "0";
|
||||
mysqli_close($link);
|
||||
|
||||
/*** test mysqli_real_connect with port ***/
|
||||
$link = mysqli_init();
|
||||
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
|
||||
? "1":"0";
|
||||
mysqli_close($link);
|
||||
/*** test mysqli_real_connect with port ***/
|
||||
$link = mysqli_init();
|
||||
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
|
||||
? "1":"0";
|
||||
mysqli_close($link);
|
||||
|
||||
/* temporary addition for Kent's setup, Win32 box */
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
if (!$link = mysqli_init())
|
||||
printf("[001 + %d] mysqli_init() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error());
|
||||
/* temporary addition for Kent's setup, Win32 box */
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
if (!$link = mysqli_init())
|
||||
printf("[001 + %d] mysqli_init() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[002 + %d] mysqli_real_connect() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error());
|
||||
if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[002 + %d] mysqli_real_connect() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
mysqli_close($link);
|
||||
}
|
||||
mysqli_close($link);
|
||||
}
|
||||
|
||||
/*** test mysqli_real_connect compressed ***/
|
||||
/*
|
||||
$link = mysqli_init();
|
||||
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, MYSQLI_CLIENT_COMPRESS))
|
||||
? "1" : "0";
|
||||
mysqli_close($link);
|
||||
/*** test mysqli_real_connect compressed ***/
|
||||
/*
|
||||
$link = mysqli_init();
|
||||
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, MYSQLI_CLIENT_COMPRESS))
|
||||
? "1" : "0";
|
||||
mysqli_close($link);
|
||||
*/
|
||||
/* todo ssl connections */
|
||||
/* todo ssl connections */
|
||||
|
||||
var_dump($test);
|
||||
print "done!";
|
||||
var_dump($test);
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
%s(4) "1111"
|
||||
|
||||
+29
-29
@@ -7,44 +7,44 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null"))
|
||||
printf("[002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null"))
|
||||
printf("[002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = mysqli_query($link,"CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint,
|
||||
col3 int, col4 bigint,
|
||||
col5 float, col6 double,
|
||||
col7 date, col8 time,
|
||||
col9 varbinary(10),
|
||||
col10 varchar(50),
|
||||
col11 char(20)) ENGINE=" . $engine);
|
||||
$rc = mysqli_query($link,"CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint,
|
||||
col3 int, col4 bigint,
|
||||
col5 float, col6 double,
|
||||
col7 date, col8 time,
|
||||
col9 varbinary(10),
|
||||
col10 varchar(50),
|
||||
col11 char(20)) ENGINE=" . $engine);
|
||||
|
||||
if (!$rc)
|
||||
printf("[003] Cannot create table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!$rc)
|
||||
printf("[003] Cannot create table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = mysqli_query($link, "INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)");
|
||||
if (!$rc)
|
||||
printf("[004] Cannot insert records, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$rc = mysqli_query($link, "INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)");
|
||||
if (!$rc)
|
||||
printf("[004] Cannot insert records, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null ORDER BY col1");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
|
||||
mysqli_stmt_execute($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null ORDER BY col1");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
|
||||
mysqli_stmt_execute($stmt);
|
||||
|
||||
mysqli_stmt_fetch($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11);
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
@mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
@mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -53,7 +53,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+54
-54
@@ -7,70 +7,70 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
|
||||
if (!mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = @mysqli_query($link,"CREATE TABLE test_bind_result(
|
||||
c1 date,
|
||||
c2 time,
|
||||
c3 timestamp(14),
|
||||
c4 year,
|
||||
c5 datetime,
|
||||
c6 timestamp(4),
|
||||
c7 timestamp(6)) ENGINE=" . $engine);
|
||||
$rc = @mysqli_query($link,"CREATE TABLE test_bind_result(
|
||||
c1 date,
|
||||
c2 time,
|
||||
c3 timestamp(14),
|
||||
c4 year,
|
||||
c5 datetime,
|
||||
c6 timestamp(4),
|
||||
c7 timestamp(6)) ENGINE=" . $engine);
|
||||
|
||||
/*
|
||||
Seems that not all MySQL 6.0 installations use defaults that ignore the display widths.
|
||||
From the manual:
|
||||
From MySQL 4.1.0 on, TIMESTAMP display format differs from that of earlier MySQL releases:
|
||||
[...]
|
||||
Display widths (used as described in the preceding section) are no longer supported.
|
||||
In other words, for declarations such as TIMESTAMP(2), TIMESTAMP(4), and so on,
|
||||
the display width is ignored.
|
||||
[...]
|
||||
*/
|
||||
if (!$rc)
|
||||
$rc = @mysqli_query($link,"CREATE TABLE test_bind_result(
|
||||
c1 date,
|
||||
c2 time,
|
||||
c3 timestamp,
|
||||
c4 year,
|
||||
c5 datetime,
|
||||
c6 timestamp,
|
||||
c7 timestamp) ENGINE=" . $engine);
|
||||
/*
|
||||
Seems that not all MySQL 6.0 installations use defaults that ignore the display widths.
|
||||
From the manual:
|
||||
From MySQL 4.1.0 on, TIMESTAMP display format differs from that of earlier MySQL releases:
|
||||
[...]
|
||||
Display widths (used as described in the preceding section) are no longer supported.
|
||||
In other words, for declarations such as TIMESTAMP(2), TIMESTAMP(4), and so on,
|
||||
the display width is ignored.
|
||||
[...]
|
||||
*/
|
||||
if (!$rc)
|
||||
$rc = @mysqli_query($link,"CREATE TABLE test_bind_result(
|
||||
c1 date,
|
||||
c2 time,
|
||||
c3 timestamp,
|
||||
c4 year,
|
||||
c5 datetime,
|
||||
c6 timestamp,
|
||||
c7 timestamp) ENGINE=" . $engine);
|
||||
|
||||
if (!$rc)
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!$rc)
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = mysqli_query($link, "INSERT INTO test_bind_result VALUES(
|
||||
'2002-01-02',
|
||||
'12:49:00',
|
||||
'2002-01-02 17:46:59',
|
||||
2010,
|
||||
'2010-07-10',
|
||||
'2020','1999-12-29')");
|
||||
if (!$rc)
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$rc = mysqli_query($link, "INSERT INTO test_bind_result VALUES(
|
||||
'2002-01-02',
|
||||
'12:49:00',
|
||||
'2002-01-02 17:46:59',
|
||||
2010,
|
||||
'2010-07-10',
|
||||
'2020','1999-12-29')");
|
||||
if (!$rc)
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT c1, c2, c3, c4, c5, c6, c7 FROM test_bind_result");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT c1, c2, c3, c4, c5, c6, c7 FROM test_bind_result");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -79,7 +79,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+32
-32
@@ -7,48 +7,48 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
include ("connect.inc");
|
||||
include ("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
if (!mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 char(10), c2 text) ENGINE=" . $engine))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 char(10), c2 text) ENGINE=" . $engine))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567890', 'this is a test0')"))
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567890', 'this is a test0')"))
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567891', 'this is a test1')"))
|
||||
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567891', 'this is a test1')"))
|
||||
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567892', 'this is a test2')"))
|
||||
printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567892', 'this is a test2')"))
|
||||
printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567893', 'this is a test3')"))
|
||||
printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567893', 'this is a test3')"))
|
||||
printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch ORDER BY c1"))
|
||||
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch ORDER BY c1"))
|
||||
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$c1 = $c2 = NULL;
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2);
|
||||
mysqli_stmt_execute($stmt);
|
||||
$i = 4;
|
||||
while ($i--) {
|
||||
mysqli_stmt_fetch($stmt);
|
||||
$test = array($c1, $c2);
|
||||
var_dump($test);
|
||||
}
|
||||
$c1 = $c2 = NULL;
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2);
|
||||
mysqli_stmt_execute($stmt);
|
||||
$i = 4;
|
||||
while ($i--) {
|
||||
mysqli_stmt_fetch($stmt);
|
||||
$test = array($c1, $c2);
|
||||
var_dump($test);
|
||||
}
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -57,7 +57,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+23
-23
@@ -7,38 +7,38 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "CREATE TABLE test_bind_fetch(c1 char(10), c2 text) ENGINE=" . $engine))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "CREATE TABLE test_bind_fetch(c1 char(10), c2 text) ENGINE=" . $engine))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$a = str_repeat("A1", 32000);
|
||||
$a = str_repeat("A1", 32000);
|
||||
|
||||
mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567890', '$a')");
|
||||
mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567890', '$a')");
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test[] = $c1;
|
||||
$test[] = ($a == $c2) ? "32K String ok" : "32K String failed";
|
||||
$test[] = $c1;
|
||||
$test[] = ($a == $c2) ? "32K String ok" : "32K String failed";
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
/* this will crash with libmysql from PHP 5.0.6 (or earlier) to 5.3.0 */
|
||||
mysqli_stmt_fetch($stmt);
|
||||
/* this will crash with libmysql from PHP 5.0.6 (or earlier) to 5.3.0 */
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -47,7 +47,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+29
-29
@@ -7,43 +7,43 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_query($link, "SET sql_mode=''"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "SET sql_mode=''"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 int unsigned,
|
||||
c2 int unsigned,
|
||||
c3 int,
|
||||
c4 int,
|
||||
c5 int,
|
||||
c6 int unsigned,
|
||||
c7 int) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$rc = mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 int unsigned,
|
||||
c2 int unsigned,
|
||||
c3 int,
|
||||
c4 int,
|
||||
c5 int,
|
||||
c6 int unsigned,
|
||||
c7 int) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES (-23,35999,NULL,-500,-9999999,-0,0)"))
|
||||
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES (-23,35999,NULL,-500,-9999999,-0,0)"))
|
||||
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -52,7 +52,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+29
-29
@@ -7,43 +7,43 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_query($link, "SET sql_mode=''"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "SET sql_mode=''"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = mysqli_query($link, "CREATE TABLE test_bind_fetch(c1 smallint unsigned,
|
||||
c2 smallint unsigned,
|
||||
c3 smallint,
|
||||
c4 smallint,
|
||||
c5 smallint,
|
||||
c6 smallint unsigned,
|
||||
c7 smallint) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$rc = mysqli_query($link, "CREATE TABLE test_bind_fetch(c1 smallint unsigned,
|
||||
c2 smallint unsigned,
|
||||
c3 smallint,
|
||||
c4 smallint,
|
||||
c5 smallint,
|
||||
c6 smallint unsigned,
|
||||
c7 smallint) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES (-23,35999,NULL,-500,-9999999,+30,0)"))
|
||||
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES (-23,35999,NULL,-500,-9999999,+30,0)"))
|
||||
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -52,7 +52,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+29
-29
@@ -7,43 +7,43 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_query($link, "SET sql_mode=''"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "SET sql_mode=''"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = mysqli_query($link, "CREATE TABLE test_bind_fetch(c1 tinyint,
|
||||
c2 tinyint unsigned,
|
||||
c3 tinyint not NULL,
|
||||
c4 tinyint,
|
||||
c5 tinyint,
|
||||
c6 tinyint unsigned,
|
||||
c7 tinyint) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$rc = mysqli_query($link, "CREATE TABLE test_bind_fetch(c1 tinyint,
|
||||
c2 tinyint unsigned,
|
||||
c3 tinyint not NULL,
|
||||
c4 tinyint,
|
||||
c5 tinyint,
|
||||
c6 tinyint unsigned,
|
||||
c7 tinyint) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES (-23,300,0,-100,-127,+30,0)"))
|
||||
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_fetch VALUES (-23,300,0,-100,-127,+30,0)"))
|
||||
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -52,7 +52,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+60
-60
@@ -2,81 +2,81 @@
|
||||
mysqli fetch bigint values (ok to fail with 4.1.x)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_SIZE == 8) {
|
||||
echo 'skip test valid only for 32bit systems';
|
||||
exit;
|
||||
}
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
if (PHP_INT_SIZE == 8) {
|
||||
echo 'skip test valid only for 32bit systems';
|
||||
exit;
|
||||
}
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_query($link, "SET sql_mode=''"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "SET sql_mode=''"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 bigint default 5,
|
||||
c2 bigint,
|
||||
c3 bigint not NULL,
|
||||
c4 bigint unsigned,
|
||||
c5 bigint unsigned,
|
||||
c6 bigint unsigned,
|
||||
c7 bigint unsigned,
|
||||
c8 bigint unsigned) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$rc = mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 bigint default 5,
|
||||
c2 bigint,
|
||||
c3 bigint not NULL,
|
||||
c4 bigint unsigned,
|
||||
c5 bigint unsigned,
|
||||
c6 bigint unsigned,
|
||||
c7 bigint unsigned,
|
||||
c8 bigint unsigned) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = mysqli_query($link, "INSERT INTO test_bind_fetch (c2,c3,c4,c5,c6,c7,c8) ".
|
||||
"VALUES (-23,4.0,33333333333333,0,-333333333333,99.9,1234)");
|
||||
if (!$rc)
|
||||
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$rc = mysqli_query($link, "INSERT INTO test_bind_fetch (c2,c3,c4,c5,c6,c7,c8) ".
|
||||
"VALUES (-23,4.0,33333333333333,0,-333333333333,99.9,1234)");
|
||||
if (!$rc)
|
||||
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
|
||||
mysqli_stmt_execute($stmt);
|
||||
$rc = mysqli_stmt_fetch($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
|
||||
mysqli_stmt_execute($stmt);
|
||||
$rc = mysqli_stmt_fetch($stmt);
|
||||
|
||||
if (mysqli_get_server_version($link) < 50000) {
|
||||
// 4.1 is faulty and will return big number for $c6
|
||||
if ($c6 == "18446743740376218283") {
|
||||
$c6 = 0;
|
||||
}
|
||||
}
|
||||
$c8 = 4567;// change this to test how mysqli/mysqlnd handles is_ref changing
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8);
|
||||
if (mysqli_get_server_version($link) < 50000) {
|
||||
// 4.1 is faulty and will return big number for $c6
|
||||
if ($c6 == "18446743740376218283") {
|
||||
$c6 = 0;
|
||||
}
|
||||
}
|
||||
$c8 = 4567;// change this to test how mysqli/mysqlnd handles is_ref changing
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch_uint"))
|
||||
printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$rc = mysqli_query($link, "CREATE TABLE test_bind_fetch_uint(c1 integer unsigned, c2 integer unsigned) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch_uint"))
|
||||
printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$rc = mysqli_query($link, "CREATE TABLE test_bind_fetch_uint(c1 integer unsigned, c2 integer unsigned) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_fetch_uint (c1,c2) VALUES (20123456, 3123456789)"))
|
||||
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_fetch_uint (c1,c2) VALUES (20123456, 3123456789)"))
|
||||
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch_uint");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2);
|
||||
mysqli_stmt_execute($stmt);
|
||||
$rc = mysqli_stmt_fetch($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch_uint");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2);
|
||||
mysqli_stmt_execute($stmt);
|
||||
$rc = mysqli_stmt_fetch($stmt);
|
||||
|
||||
echo $c1, "\n", $c2, "\n";
|
||||
echo $c1, "\n", $c2, "\n";
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch_uint");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch_uint");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -85,10 +85,10 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch_uint"))
|
||||
printf("[002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+29
-29
@@ -9,44 +9,44 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_query($link, "SET sql_mode=''"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "SET sql_mode=''"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = mysqli_query($link, "CREATE TABLE test_bind_fetch(c1 float(3),
|
||||
c2 float,
|
||||
c3 float unsigned,
|
||||
c4 float,
|
||||
c5 float,
|
||||
c6 float,
|
||||
c7 float(10) unsigned) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$rc = mysqli_query($link, "CREATE TABLE test_bind_fetch(c1 float(3),
|
||||
c2 float,
|
||||
c3 float unsigned,
|
||||
c4 float,
|
||||
c5 float,
|
||||
c6 float,
|
||||
c7 float(10) unsigned) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
|
||||
mysqli_query($link, "INSERT INTO test_bind_fetch (c1,c2,c3,c4,c5,c6,c7) VALUES (3.1415926535,-0.000001, -5, 999999999999,
|
||||
sin(0.6), 1.00000000000001, 888888888888888)");
|
||||
mysqli_query($link, "INSERT INTO test_bind_fetch (c1,c2,c3,c4,c5,c6,c7) VALUES (3.1415926535,-0.000001, -5, 999999999999,
|
||||
sin(0.6), 1.00000000000001, 888888888888888)");
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -55,7 +55,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+28
-28
@@ -9,41 +9,41 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = mysqli_query($link, "CREATE TABLE test_bind_result(c1 tinyint, c2 smallint,
|
||||
c3 int, c4 bigint,
|
||||
c5 float, c6 double,
|
||||
c7 varbinary(10),
|
||||
c8 varchar(50)) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$rc = mysqli_query($link, "CREATE TABLE test_bind_result(c1 tinyint, c2 smallint,
|
||||
c3 int, c4 bigint,
|
||||
c5 float, c6 double,
|
||||
c7 varbinary(10),
|
||||
c8 varchar(50)) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = mysqli_query($link,"INSERT INTO test_bind_result VALUES(19,2999,3999,4999999,
|
||||
2345.6,5678.89563,
|
||||
'foobar','mysql rulez')");
|
||||
if (!$rc)
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$rc = mysqli_query($link,"INSERT INTO test_bind_result VALUES(19,2999,3999,4999999,
|
||||
2345.6,5678.89563,
|
||||
'foobar','mysql rulez')");
|
||||
if (!$rc)
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8);
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -52,7 +52,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+27
-27
@@ -9,40 +9,40 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = mysqli_query($link, "CREATE TABLE test_bind_result(c1 tinyint, c2 smallint,
|
||||
c3 int, c4 bigint,
|
||||
c5 float, c6 double,
|
||||
c7 varbinary(10),
|
||||
c8 varchar(10)) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$rc = mysqli_query($link, "CREATE TABLE test_bind_result(c1 tinyint, c2 smallint,
|
||||
c3 int, c4 bigint,
|
||||
c5 float, c6 double,
|
||||
c7 varbinary(10),
|
||||
c8 varchar(10)) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_result VALUES(120,2999,3999,54,
|
||||
2.6,58.89,
|
||||
'206','6.7')"))
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_result VALUES(120,2999,3999,54,
|
||||
2.6,58.89,
|
||||
'206','6.7')"))
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8);
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -51,7 +51,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+40
-40
@@ -7,54 +7,54 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = mysqli_query($link, "CREATE TABLE test_bind_result(c1 tinyint, c2 smallint,
|
||||
c3 int, c4 bigint,
|
||||
c5 decimal(4,2), c6 double,
|
||||
c7 varbinary(10),
|
||||
c8 varchar(10)) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$rc = mysqli_query($link, "CREATE TABLE test_bind_result(c1 tinyint, c2 smallint,
|
||||
c3 int, c4 bigint,
|
||||
c5 decimal(4,2), c6 double,
|
||||
c7 varbinary(10),
|
||||
c8 varchar(10)) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_result VALUES(120,2999,3999,54,
|
||||
2.6,58.89,
|
||||
'206','6.7')"))
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "INSERT INTO test_bind_result VALUES(120,2999,3999,54,
|
||||
2.6,58.89,
|
||||
'206','6.7')"))
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result");
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result");
|
||||
|
||||
$c = array(0,0,0,0,0,0,0,0);
|
||||
$b_res= mysqli_stmt_bind_result($stmt, $c[0], $c[1], $c[2], $c[3], $c[4], $c[5], $c[6], $c[7]);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
$c = array(0,0,0,0,0,0,0,0);
|
||||
$b_res= mysqli_stmt_bind_result($stmt, $c[0], $c[1], $c[2], $c[3], $c[4], $c[5], $c[6], $c[7]);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
|
||||
$result = mysqli_query($link, "select * from test_bind_result");
|
||||
$d = mysqli_fetch_row($result);
|
||||
mysqli_free_result($result);
|
||||
$result = mysqli_query($link, "select * from test_bind_result");
|
||||
$d = mysqli_fetch_row($result);
|
||||
mysqli_free_result($result);
|
||||
|
||||
$test = "";
|
||||
for ($i=0; $i < count($c); $i++)
|
||||
$test .= ($c[$i] == $d[$i]) ? "1" : "0";
|
||||
if ($test == "11111111")
|
||||
echo "ok\n";
|
||||
else if ($b_res == FALSE && mysqli_get_client_version() > 40100 && mysqli_get_client_version() < 50000 &&
|
||||
mysqli_get_server_version($link) > 50000)
|
||||
echo "error (4.1 library with 5.x server)";
|
||||
else
|
||||
echo "error";
|
||||
$test = "";
|
||||
for ($i=0; $i < count($c); $i++)
|
||||
$test .= ($c[$i] == $d[$i]) ? "1" : "0";
|
||||
if ($test == "11111111")
|
||||
echo "ok\n";
|
||||
else if ($b_res == FALSE && mysqli_get_client_version() > 40100 && mysqli_get_client_version() < 50000 &&
|
||||
mysqli_get_server_version($link) > 50000)
|
||||
echo "error (4.1 library with 5.x server)";
|
||||
else
|
||||
echo "error";
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -63,7 +63,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+49
-49
@@ -2,83 +2,83 @@
|
||||
mysqli autocommit/commit/rollback
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
require_once("connect.inc");
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
require_once("connect.inc");
|
||||
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
if (!$link)
|
||||
die(sprintf("skip Cannot connect, [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
if (!$link)
|
||||
die(sprintf("skip Cannot connect, [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
|
||||
|
||||
if (!have_innodb($link))
|
||||
die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error));
|
||||
if (!have_innodb($link))
|
||||
die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error));
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
require_once("connect.inc");
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_autocommit($link, TRUE))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_autocommit($link, TRUE))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test"))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test"))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "CREATE TABLE test(a int, b varchar(10)) engine=InnoDB"))
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "CREATE TABLE test(a int, b varchar(10)) engine=InnoDB"))
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "INSERT INTO test VALUES (1, 'foobar')"))
|
||||
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "INSERT INTO test VALUES (1, 'foobar')"))
|
||||
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_autocommit($link, FALSE))
|
||||
printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_autocommit($link, FALSE))
|
||||
printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "DELETE FROM test"))
|
||||
printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "DELETE FROM test"))
|
||||
printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "INSERT INTO test VALUES (2, 'egon')"))
|
||||
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "INSERT INTO test VALUES (2, 'egon')"))
|
||||
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_rollback($link))
|
||||
printf("[008] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_rollback($link))
|
||||
printf("[008] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!$result = mysqli_query($link, "SELECT * FROM test"))
|
||||
printf("[009] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!$result = mysqli_query($link, "SELECT * FROM test"))
|
||||
printf("[009] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
printf("Num_of_rows=%d\n", mysqli_num_rows($result));
|
||||
if (!$row = mysqli_fetch_row($result))
|
||||
printf("[010] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("Num_of_rows=%d\n", mysqli_num_rows($result));
|
||||
if (!$row = mysqli_fetch_row($result))
|
||||
printf("[010] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_free_result($result);
|
||||
mysqli_free_result($result);
|
||||
|
||||
var_dump($row);
|
||||
var_dump($row);
|
||||
|
||||
if (!mysqli_query($link, "DELETE FROM test"))
|
||||
printf("[011] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "DELETE FROM test"))
|
||||
printf("[011] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "INSERT INTO test VALUES (2, 'egon')"))
|
||||
printf("[012] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "INSERT INTO test VALUES (2, 'egon')"))
|
||||
printf("[012] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_commit($link))
|
||||
printf("[012] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_commit($link))
|
||||
printf("[012] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!$result = mysqli_query($link, "SELECT * FROM test"))
|
||||
printf("[013] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!$result = mysqli_query($link, "SELECT * FROM test"))
|
||||
printf("[013] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!$row = mysqli_fetch_row($result))
|
||||
printf("[014] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!$row = mysqli_fetch_row($result))
|
||||
printf("[014] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_free_result($result);
|
||||
mysqli_free_result($result);
|
||||
|
||||
var_dump($row);
|
||||
var_dump($row);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require_once("clean_table.inc");
|
||||
require_once("clean_table.inc");
|
||||
?>
|
||||
--EXPECT--
|
||||
Num_of_rows=1
|
||||
|
||||
+53
-53
@@ -2,81 +2,81 @@
|
||||
mysqli autocommit/commit/rollback with innodb
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
|
||||
require_once('connect.inc');
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
die(sprintf("skip Cannot connect, [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
|
||||
require_once('connect.inc');
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
die(sprintf("skip Cannot connect, [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
|
||||
|
||||
if (!have_innodb($link))
|
||||
die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error));
|
||||
if (!have_innodb($link))
|
||||
die(sprintf("skip Needs InnoDB support, [%d] %s", $link->errno, $link->error));
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
if (!$link)
|
||||
printf("[001] Cannot connect, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
if (!$link)
|
||||
printf("[001] Cannot connect, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_select_db($link, $db))
|
||||
printf("[002] Cannot select DB '%s', [%d] %s\n", $db,
|
||||
mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_select_db($link, $db))
|
||||
printf("[002] Cannot select DB '%s', [%d] %s\n", $db,
|
||||
mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_autocommit($link, TRUE))
|
||||
printf("[003] Cannot turn on autocommit mode, [%d] %s\n",
|
||||
mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_autocommit($link, TRUE))
|
||||
printf("[003] Cannot turn on autocommit mode, [%d] %s\n",
|
||||
mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link,"DROP TABLE IF EXISTS test") ||
|
||||
!mysqli_query($link,"CREATE TABLE test(a int, b varchar(10)) Engine=InnoDB") ||
|
||||
!mysqli_query($link, "INSERT INTO test VALUES (1, 'foobar')"))
|
||||
printf("[004] Cannot create test data, [%d] %s\n",
|
||||
mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link,"DROP TABLE IF EXISTS test") ||
|
||||
!mysqli_query($link,"CREATE TABLE test(a int, b varchar(10)) Engine=InnoDB") ||
|
||||
!mysqli_query($link, "INSERT INTO test VALUES (1, 'foobar')"))
|
||||
printf("[004] Cannot create test data, [%d] %s\n",
|
||||
mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_autocommit($link, FALSE))
|
||||
printf("[005] Cannot turn off autocommit mode, [%d] %s\n",
|
||||
mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_autocommit($link, FALSE))
|
||||
printf("[005] Cannot turn off autocommit mode, [%d] %s\n",
|
||||
mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, "DELETE FROM test") ||
|
||||
!mysqli_query($link, "INSERT INTO test VALUES (2, 'egon')"))
|
||||
printf("[006] Cannot modify test data, [%d] %s\n",
|
||||
mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "DELETE FROM test") ||
|
||||
!mysqli_query($link, "INSERT INTO test VALUES (2, 'egon')"))
|
||||
printf("[006] Cannot modify test data, [%d] %s\n",
|
||||
mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_rollback($link))
|
||||
printf("[007] Cannot call rollback, [%d] %s\n",
|
||||
mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_rollback($link))
|
||||
printf("[007] Cannot call rollback, [%d] %s\n",
|
||||
mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$result = mysqli_query($link, "SELECT SQL_NO_CACHE * FROM test");
|
||||
if (!$result)
|
||||
printf("[008] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$row = mysqli_fetch_row($result);
|
||||
mysqli_free_result($result);
|
||||
$result = mysqli_query($link, "SELECT SQL_NO_CACHE * FROM test");
|
||||
if (!$result)
|
||||
printf("[008] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$row = mysqli_fetch_row($result);
|
||||
mysqli_free_result($result);
|
||||
|
||||
var_dump($row);
|
||||
var_dump($row);
|
||||
|
||||
if (!mysqli_query($link, "DELETE FROM test") ||
|
||||
!mysqli_query($link, "INSERT INTO test VALUES (2, 'egon')"))
|
||||
printf("[009] Cannot modify test data, [%d] %s\n",
|
||||
mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "DELETE FROM test") ||
|
||||
!mysqli_query($link, "INSERT INTO test VALUES (2, 'egon')"))
|
||||
printf("[009] Cannot modify test data, [%d] %s\n",
|
||||
mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_commit($link);
|
||||
mysqli_commit($link);
|
||||
|
||||
$result = mysqli_query($link, "SELECT * FROM test");
|
||||
if (!$result)
|
||||
printf("[010] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$row = mysqli_fetch_row($result);
|
||||
mysqli_free_result($result);
|
||||
$result = mysqli_query($link, "SELECT * FROM test");
|
||||
if (!$result)
|
||||
printf("[010] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$row = mysqli_fetch_row($result);
|
||||
mysqli_free_result($result);
|
||||
|
||||
var_dump($row);
|
||||
var_dump($row);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require_once("clean_table.inc");
|
||||
require_once("clean_table.inc");
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
|
||||
+14
-14
@@ -7,26 +7,26 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_query($link, "SET @dummy='foobar'"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "SET @dummy='foobar'"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!$stmt = mysqli_prepare($link, "SELECT @dummy"))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!$stmt = mysqli_prepare($link, "SELECT @dummy"))
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_stmt_bind_result($stmt, $dummy);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
mysqli_stmt_bind_result($stmt, $dummy);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
var_dump($dummy);
|
||||
var_dump($dummy);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foobar"
|
||||
|
||||
+16
-16
@@ -8,28 +8,28 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
if (!$stmt = mysqli_prepare($link, "SELECT md5('bar'), database(), 'foo'"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!$stmt = mysqli_prepare($link, "SELECT md5('bar'), database(), 'foo'"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_stmt_bind_result($stmt, $c0, $c1, $c2);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_bind_result($stmt, $c0, $c1, $c2);
|
||||
mysqli_stmt_execute($stmt);
|
||||
|
||||
mysqli_stmt_fetch($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
|
||||
$test = array($c0, $c1, $c2);
|
||||
if ($c1 !== $db) {
|
||||
echo "Different data\n";
|
||||
}
|
||||
$test = array($c0, $c1, $c2);
|
||||
if ($c1 !== $db) {
|
||||
echo "Different data\n";
|
||||
}
|
||||
|
||||
var_dump($test);
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
var_dump($test);
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(3) {
|
||||
|
||||
+13
-13
@@ -7,26 +7,26 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_query($link, "SET AUTOCOMMIT=0"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "SET AUTOCOMMIT=0"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!$stmt = mysqli_prepare($link, "SELECT @@autocommit"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!$stmt = mysqli_prepare($link, "SELECT @@autocommit"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_stmt_bind_result($stmt, $c0);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_bind_result($stmt, $c0);
|
||||
mysqli_stmt_execute($stmt);
|
||||
|
||||
mysqli_stmt_fetch($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
var_dump($c0);
|
||||
var_dump($c0);
|
||||
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECT--
|
||||
int(0)
|
||||
|
||||
+35
-35
@@ -7,53 +7,53 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS insert_read"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS insert_read"))
|
||||
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
$rc = mysqli_query($link,"CREATE TABLE insert_read(col1 tinyint, col2 smallint,
|
||||
col3 int, col4 bigint,
|
||||
col5 float, col6 double,
|
||||
col7 date, col8 time,
|
||||
col9 varbinary(10),
|
||||
col10 varchar(50),
|
||||
col11 char(20)) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
$rc = mysqli_query($link,"CREATE TABLE insert_read(col1 tinyint, col2 smallint,
|
||||
col3 int, col4 bigint,
|
||||
col5 float, col6 double,
|
||||
col7 date, col8 time,
|
||||
col9 varbinary(10),
|
||||
col10 varchar(50),
|
||||
col11 char(20)) ENGINE=" . $engine);
|
||||
if (!$rc)
|
||||
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!$stmt = mysqli_prepare($link, "INSERT INTO insert_read(col1,col10, col11, col6) VALUES (?,?,?,?)"))
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!$stmt = mysqli_prepare($link, "INSERT INTO insert_read(col1,col10, col11, col6) VALUES (?,?,?,?)"))
|
||||
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_stmt_bind_param($stmt, "issd", $c1, $c2, $c3, $c4);
|
||||
mysqli_stmt_bind_param($stmt, "issd", $c1, $c2, $c3, $c4);
|
||||
|
||||
$c1 = 1;
|
||||
$c2 = "foo";
|
||||
$c3 = "foobar";
|
||||
$c4 = 3.14;
|
||||
$c1 = 1;
|
||||
$c2 = "foo";
|
||||
$c3 = "foobar";
|
||||
$c4 = 3.14;
|
||||
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
|
||||
if (!$stmt = mysqli_prepare($link, "SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 FROM insert_read"))
|
||||
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!$stmt = mysqli_prepare($link, "SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 FROM insert_read"))
|
||||
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
|
||||
mysqli_stmt_execute($stmt);
|
||||
|
||||
mysqli_stmt_fetch($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11);
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS insert_read");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS insert_read");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -62,7 +62,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS insert_read"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+45
-45
@@ -7,65 +7,65 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result");
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result");
|
||||
|
||||
$rc = @mysqli_query($link,"CREATE TABLE test_bind_result(
|
||||
c1 date,
|
||||
c2 time,
|
||||
c3 timestamp(14),
|
||||
c4 year,
|
||||
c5 datetime,
|
||||
c6 timestamp(4),
|
||||
c7 timestamp(6))");
|
||||
$rc = @mysqli_query($link,"CREATE TABLE test_bind_result(
|
||||
c1 date,
|
||||
c2 time,
|
||||
c3 timestamp(14),
|
||||
c4 year,
|
||||
c5 datetime,
|
||||
c6 timestamp(4),
|
||||
c7 timestamp(6))");
|
||||
|
||||
if (!$rc)
|
||||
$rc = mysqli_query($link,"CREATE TABLE test_bind_result(
|
||||
c1 date,
|
||||
c2 time,
|
||||
c3 timestamp,
|
||||
c4 year,
|
||||
c5 datetime,
|
||||
c6 timestamp,
|
||||
c7 timestamp)");
|
||||
if (!$rc)
|
||||
$rc = mysqli_query($link,"CREATE TABLE test_bind_result(
|
||||
c1 date,
|
||||
c2 time,
|
||||
c3 timestamp,
|
||||
c4 year,
|
||||
c5 datetime,
|
||||
c6 timestamp,
|
||||
c7 timestamp)");
|
||||
|
||||
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_result VALUES (?,?,?,?,?,?,?)");
|
||||
mysqli_stmt_bind_param($stmt, "sssssss", $d1, $d2, $d3, $d4, $d5, $d6, $d7);
|
||||
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_result VALUES (?,?,?,?,?,?,?)");
|
||||
mysqli_stmt_bind_param($stmt, "sssssss", $d1, $d2, $d3, $d4, $d5, $d6, $d7);
|
||||
|
||||
$d1 = "2002-01-02";
|
||||
$d2 = "12:49:00";
|
||||
$d3 = "2002-01-02 17:46:59";
|
||||
$d4 = "2010";
|
||||
$d5 = "2010-07-10";
|
||||
$d6 = "2020";
|
||||
$d7 = "1999-12-29";
|
||||
$d1 = "2002-01-02";
|
||||
$d2 = "12:49:00";
|
||||
$d3 = "2002-01-02 17:46:59";
|
||||
$d4 = "2010";
|
||||
$d5 = "2010-07-10";
|
||||
$d6 = "2020";
|
||||
$d7 = "1999-12-29";
|
||||
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT c1, c2, c3, c4, c5, c6, c7 FROM test_bind_result");
|
||||
$stmt = mysqli_prepare($link, "SELECT c1, c2, c3, c4, c5, c6, c7 FROM test_bind_result");
|
||||
|
||||
mysqli_stmt_bind_result($stmt,$c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_bind_result($stmt,$c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result");
|
||||
mysqli_close($link);
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result");
|
||||
mysqli_close($link);
|
||||
|
||||
print "done!";
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -74,7 +74,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+23
-23
@@ -7,36 +7,36 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 char(10), c2 text)");
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 char(10), c2 text)");
|
||||
|
||||
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?)");
|
||||
mysqli_stmt_bind_param($stmt, "ss", $q1, $q2);
|
||||
$q1 = "1234567890";
|
||||
$q2 = "this is a test";
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?)");
|
||||
mysqli_stmt_bind_param($stmt, "ss", $q1, $q2);
|
||||
$q1 = "1234567890";
|
||||
$q2 = "this is a test";
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test = array($c1,$c2);
|
||||
$test = array($c1,$c2);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -45,7 +45,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+24
-24
@@ -7,41 +7,41 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 char(10), c2 text)");
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 char(10), c2 text)");
|
||||
|
||||
|
||||
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?)");
|
||||
mysqli_stmt_bind_param($stmt, "ss", $a1, $a2);
|
||||
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?)");
|
||||
mysqli_stmt_bind_param($stmt, "ss", $a1, $a2);
|
||||
|
||||
$a1 = "1234567890";
|
||||
$a2 = str_repeat("A1", 32000);
|
||||
$a1 = "1234567890";
|
||||
$a2 = str_repeat("A1", 32000);
|
||||
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test[] = $c1;
|
||||
$test[] = ($a2 == $c2) ? "32K String ok" : "32K String failed";
|
||||
$test[] = $c1;
|
||||
$test[] = ($a2 == $c2) ? "32K String ok" : "32K String failed";
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
|
||||
print "done!";
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -50,7 +50,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+35
-35
@@ -7,50 +7,50 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 int unsigned,
|
||||
c2 int unsigned,
|
||||
c3 int,
|
||||
c4 int,
|
||||
c5 int,
|
||||
c6 int unsigned,
|
||||
c7 int)");
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 int unsigned,
|
||||
c2 int unsigned,
|
||||
c3 int,
|
||||
c4 int,
|
||||
c5 int,
|
||||
c6 int unsigned,
|
||||
c7 int)");
|
||||
|
||||
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)");
|
||||
mysqli_stmt_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
$c1 = -23;
|
||||
$c2 = 35999;
|
||||
$c3 = NULL;
|
||||
$c4 = -500;
|
||||
$c5 = -9999999;
|
||||
$c6 = -0;
|
||||
$c7 = 0;
|
||||
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)");
|
||||
mysqli_stmt_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
$c1 = -23;
|
||||
$c2 = 35999;
|
||||
$c3 = NULL;
|
||||
$c4 = -500;
|
||||
$c5 = -9999999;
|
||||
$c6 = -0;
|
||||
$c7 = 0;
|
||||
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
|
||||
print "done!";
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -59,7 +59,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+35
-35
@@ -7,50 +7,50 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned,
|
||||
c2 smallint unsigned,
|
||||
c3 smallint,
|
||||
c4 smallint,
|
||||
c5 smallint,
|
||||
c6 smallint unsigned,
|
||||
c7 smallint)");
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned,
|
||||
c2 smallint unsigned,
|
||||
c3 smallint,
|
||||
c4 smallint,
|
||||
c5 smallint,
|
||||
c6 smallint unsigned,
|
||||
c7 smallint)");
|
||||
|
||||
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)");
|
||||
mysqli_stmt_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)");
|
||||
mysqli_stmt_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
|
||||
$c1 = -23;
|
||||
$c2 = 35999;
|
||||
$c3 = NULL;
|
||||
$c4 = -500;
|
||||
$c5 = -9999999;
|
||||
$c6 = -0;
|
||||
$c7 = 0;
|
||||
$c1 = -23;
|
||||
$c2 = 35999;
|
||||
$c3 = NULL;
|
||||
$c4 = -500;
|
||||
$c5 = -9999999;
|
||||
$c6 = -0;
|
||||
$c7 = 0;
|
||||
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -59,7 +59,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+37
-37
@@ -7,55 +7,55 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 tinyint,
|
||||
c2 tinyint unsigned,
|
||||
c3 tinyint not NULL,
|
||||
c4 tinyint,
|
||||
c5 tinyint,
|
||||
c6 tinyint unsigned,
|
||||
c7 tinyint)");
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 tinyint,
|
||||
c2 tinyint unsigned,
|
||||
c3 tinyint not NULL,
|
||||
c4 tinyint,
|
||||
c5 tinyint,
|
||||
c6 tinyint unsigned,
|
||||
c7 tinyint)");
|
||||
|
||||
$stmt = mysqli_prepare ($link, "INSERT INTO test_bind_fetch VALUES(?,?,?,?,?,?,?)");
|
||||
mysqli_stmt_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
$stmt = mysqli_prepare ($link, "INSERT INTO test_bind_fetch VALUES(?,?,?,?,?,?,?)");
|
||||
mysqli_stmt_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
|
||||
$c1 = -23;
|
||||
$c2 = 300;
|
||||
$c3 = 0;
|
||||
$c4 = -100;
|
||||
$c5 = -127;
|
||||
$c6 = 30;
|
||||
$c7 = 0;
|
||||
$c1 = -23;
|
||||
$c2 = 300;
|
||||
$c3 = 0;
|
||||
$c4 = -100;
|
||||
$c5 = -127;
|
||||
$c6 = 30;
|
||||
$c7 = 0;
|
||||
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
|
||||
mysqli_query($link, "INSERT INTO test_bind_fetch VALUES (-23,300,0,-100,-127,+30,0)");
|
||||
mysqli_query($link, "INSERT INTO test_bind_fetch VALUES (-23,300,0,-100,-127,+30,0)");
|
||||
|
||||
$c1 = $c2 = $c3 = $c4 = $c5 = $c6 = $c7 = NULL;
|
||||
$c1 = $c2 = $c3 = $c4 = $c5 = $c6 = $c7 = NULL;
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
|
||||
print "done!";
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -64,7 +64,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+26
-26
@@ -7,42 +7,42 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 varchar(10), c2 text)");
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 varchar(10), c2 text)");
|
||||
|
||||
$stmt = mysqli_prepare ($link, "INSERT INTO test_bind_fetch VALUES (?,?)");
|
||||
mysqli_stmt_bind_param($stmt, "sb", $c1, $c2);
|
||||
$stmt = mysqli_prepare ($link, "INSERT INTO test_bind_fetch VALUES (?,?)");
|
||||
mysqli_stmt_bind_param($stmt, "sb", $c1, $c2);
|
||||
|
||||
$c1 = "Hello World";
|
||||
$c1 = "Hello World";
|
||||
|
||||
mysqli_stmt_send_long_data($stmt, 1, "This is the first sentence.");
|
||||
mysqli_stmt_send_long_data($stmt, 1, " And this is the second sentence.");
|
||||
mysqli_stmt_send_long_data($stmt, 1, " And finally this is the last sentence.");
|
||||
mysqli_stmt_send_long_data($stmt, 1, "This is the first sentence.");
|
||||
mysqli_stmt_send_long_data($stmt, 1, " And this is the second sentence.");
|
||||
mysqli_stmt_send_long_data($stmt, 1, " And finally this is the last sentence.");
|
||||
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $d1, $d2);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
|
||||
mysqli_stmt_bind_result($stmt, $d1, $d2);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
$test = array($d1,$d2);
|
||||
$test = array($d1,$d2);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -51,7 +51,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
@@ -7,17 +7,17 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$status = mysqli_stat($link);
|
||||
$status = mysqli_stat($link);
|
||||
|
||||
var_dump(strlen($status) > 0);
|
||||
var_dump(strlen($status) > 0);
|
||||
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
|
||||
@@ -7,17 +7,17 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$cset = substr(mysqli_character_set_name($link),0,6);
|
||||
$cset = substr(mysqli_character_set_name($link),0,6);
|
||||
|
||||
var_dump($cset);
|
||||
var_dump($cset);
|
||||
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "%s"
|
||||
|
||||
+13
-13
@@ -7,24 +7,24 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS general_test");
|
||||
mysqli_query($link, "CREATE TABLE general_test (a INT)");
|
||||
mysqli_query($link, "INSERT INTO general_test VALUES (1),(2),(3)");
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS general_test");
|
||||
mysqli_query($link, "CREATE TABLE general_test (a INT)");
|
||||
mysqli_query($link, "INSERT INTO general_test VALUES (1),(2),(3)");
|
||||
|
||||
$afc = mysqli_affected_rows($link);
|
||||
$afc = mysqli_affected_rows($link);
|
||||
|
||||
var_dump($afc);
|
||||
var_dump($afc);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS general_test");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS general_test");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -33,7 +33,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS general_test"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+11
-11
@@ -7,22 +7,22 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
$errno = mysqli_errno($link);
|
||||
var_dump($errno);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
$errno = mysqli_errno($link);
|
||||
var_dump($errno);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
mysqli_query($link, "SELECT * FROM non_exisiting_table");
|
||||
$errno = mysqli_errno($link);
|
||||
mysqli_query($link, "SELECT * FROM non_exisiting_table");
|
||||
$errno = mysqli_errno($link);
|
||||
|
||||
var_dump($errno);
|
||||
var_dump($errno);
|
||||
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECT--
|
||||
int(0)
|
||||
|
||||
+11
-11
@@ -7,22 +7,22 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
$error = mysqli_error($link);
|
||||
var_dump($error);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
$error = mysqli_error($link);
|
||||
var_dump($error);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
mysqli_query($link, "SELECT * FROM non_exisiting_table");
|
||||
$error = mysqli_error($link);
|
||||
mysqli_query($link, "SELECT * FROM non_exisiting_table");
|
||||
$error = mysqli_error($link);
|
||||
|
||||
var_dump($error);
|
||||
var_dump($error);
|
||||
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(0) ""
|
||||
|
||||
+13
-13
@@ -7,24 +7,24 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS general_test");
|
||||
mysqli_query($link, "CREATE TABLE general_test (a INT)");
|
||||
mysqli_query($link, "INSERT INTO general_test VALUES (1),(2),(3)");
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS general_test");
|
||||
mysqli_query($link, "CREATE TABLE general_test (a INT)");
|
||||
mysqli_query($link, "INSERT INTO general_test VALUES (1),(2),(3)");
|
||||
|
||||
$afc = mysqli_info($link);
|
||||
$afc = mysqli_info($link);
|
||||
|
||||
var_dump($afc);
|
||||
var_dump($afc);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS general_test");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS general_test");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -33,7 +33,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS general_test"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
@@ -8,17 +8,17 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$hinfo = mysqli_get_host_info($link);
|
||||
$hinfo = mysqli_get_host_info($link);
|
||||
|
||||
var_dump(str_replace('/','', $hinfo));
|
||||
var_dump(str_replace('/','', $hinfo));
|
||||
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "%s via %s"
|
||||
|
||||
@@ -8,17 +8,17 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$pinfo = mysqli_get_proto_info($link);
|
||||
$pinfo = mysqli_get_proto_info($link);
|
||||
|
||||
var_dump($pinfo);
|
||||
var_dump($pinfo);
|
||||
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECT--
|
||||
int(10)
|
||||
|
||||
@@ -7,17 +7,17 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$sinfo = substr(mysqli_get_server_info($link),0,1);
|
||||
$sinfo = substr(mysqli_get_server_info($link),0,1);
|
||||
|
||||
var_dump(strlen($sinfo));
|
||||
var_dump(strlen($sinfo));
|
||||
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
|
||||
+29
-29
@@ -2,45 +2,45 @@
|
||||
function test: mysqli_insert_id()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_SIZE == 8) {
|
||||
echo 'skip test valid only for 32bit systems';
|
||||
exit;
|
||||
}
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
if (PHP_INT_SIZE == 8) {
|
||||
echo 'skip test valid only for 32bit systems';
|
||||
exit;
|
||||
}
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS t036");
|
||||
mysqli_query($link, "CREATE TABLE t036 (a bigint not null auto_increment primary key, b varchar(10)) ENGINE = " . $engine);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS t036");
|
||||
mysqli_query($link, "CREATE TABLE t036 (a bigint not null auto_increment primary key, b varchar(10)) ENGINE = " . $engine);
|
||||
|
||||
mysqli_query($link, "INSERT INTO t036 (b) VALUES ('foo1')");
|
||||
$test[] = mysqli_insert_id($link);
|
||||
mysqli_query($link, "INSERT INTO t036 (b) VALUES ('foo1')");
|
||||
$test[] = mysqli_insert_id($link);
|
||||
|
||||
/* we have to insert more values, cause lexer sets auto_increment to max_int
|
||||
see mysql bug #54. So we don't check for the value, only for type (which must
|
||||
be type string)
|
||||
*/
|
||||
/* we have to insert more values, cause lexer sets auto_increment to max_int
|
||||
see mysql bug #54. So we don't check for the value, only for type (which must
|
||||
be type string)
|
||||
*/
|
||||
|
||||
mysqli_query($link, "ALTER TABLE t036 AUTO_INCREMENT=9999999999999998");
|
||||
mysqli_query($link, "INSERT INTO t036 (b) VALUES ('foo2')");
|
||||
mysqli_query($link, "INSERT INTO t036 (b) VALUES ('foo3')");
|
||||
mysqli_query($link, "INSERT INTO t036 (b) VALUES ('foo4')");
|
||||
$x = mysqli_insert_id($link);
|
||||
$test[] = is_string($x);
|
||||
mysqli_query($link, "ALTER TABLE t036 AUTO_INCREMENT=9999999999999998");
|
||||
mysqli_query($link, "INSERT INTO t036 (b) VALUES ('foo2')");
|
||||
mysqli_query($link, "INSERT INTO t036 (b) VALUES ('foo3')");
|
||||
mysqli_query($link, "INSERT INTO t036 (b) VALUES ('foo4')");
|
||||
$x = mysqli_insert_id($link);
|
||||
$test[] = is_string($x);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS t036");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS t036");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -49,7 +49,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS t036"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+15
-15
@@ -8,29 +8,29 @@ require_once('skipifconnectfailure.inc');
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_result");
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_result");
|
||||
|
||||
mysqli_query($link, "CREATE TABLE test_result (a int, b varchar(10)) ENGINE = " . $engine);
|
||||
mysqli_query($link, "CREATE TABLE test_result (a int, b varchar(10)) ENGINE = " . $engine);
|
||||
|
||||
mysqli_query($link, "INSERT INTO test_result VALUES (1, 'foo')");
|
||||
$ir[] = mysqli_field_count($link);
|
||||
mysqli_query($link, "INSERT INTO test_result VALUES (1, 'foo')");
|
||||
$ir[] = mysqli_field_count($link);
|
||||
|
||||
mysqli_real_query($link, "SELECT * FROM test_result");
|
||||
$ir[] = mysqli_field_count($link);
|
||||
mysqli_real_query($link, "SELECT * FROM test_result");
|
||||
$ir[] = mysqli_field_count($link);
|
||||
|
||||
|
||||
var_dump($ir);
|
||||
var_dump($ir);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_result");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_result");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -39,7 +39,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_result"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+17
-17
@@ -7,30 +7,30 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_result");
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_result");
|
||||
|
||||
mysqli_query($link, "CREATE TABLE test_result (a int, b varchar(10)) ENGINE = " . $engine);
|
||||
mysqli_query($link, "CREATE TABLE test_result (a int, b varchar(10)) ENGINE = " . $engine);
|
||||
|
||||
mysqli_query($link, "INSERT INTO test_result VALUES (1, 'foo')");
|
||||
mysqli_query($link, "INSERT INTO test_result VALUES (1, 'foo')");
|
||||
|
||||
mysqli_real_query($link, "SELECT * FROM test_result");
|
||||
if (mysqli_field_count($link)) {
|
||||
$result = mysqli_store_result($link);
|
||||
$num = mysqli_num_fields($result);
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
mysqli_real_query($link, "SELECT * FROM test_result");
|
||||
if (mysqli_field_count($link)) {
|
||||
$result = mysqli_store_result($link);
|
||||
$num = mysqli_num_fields($result);
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
|
||||
var_dump($num);
|
||||
var_dump($num);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_result");
|
||||
mysqli_close($link);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_result");
|
||||
mysqli_close($link);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -39,7 +39,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_result"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+12
-12
@@ -7,23 +7,23 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_real_query($link, "SHOW VARIABLES");
|
||||
mysqli_real_query($link, "SHOW VARIABLES");
|
||||
|
||||
if (mysqli_field_count($link)) {
|
||||
$result = mysqli_store_result($link);
|
||||
$num = mysqli_num_fields($result);
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
if (mysqli_field_count($link)) {
|
||||
$result = mysqli_store_result($link);
|
||||
$num = mysqli_num_fields($result);
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
|
||||
var_dump($num);
|
||||
var_dump($num);
|
||||
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2)
|
||||
|
||||
+18
-18
@@ -7,29 +7,29 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_result");
|
||||
mysqli_query($link, "CREATE TABLE test_result (a int, b varchar(10)) ENGINE=" . $engine);
|
||||
mysqli_query($link, "INSERT INTO test_result VALUES (1, 'foo')");
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_result");
|
||||
mysqli_query($link, "CREATE TABLE test_result (a int, b varchar(10)) ENGINE=" . $engine);
|
||||
mysqli_query($link, "INSERT INTO test_result VALUES (1, 'foo')");
|
||||
|
||||
mysqli_real_query($link, "SELECT * FROM test_result");
|
||||
if (mysqli_field_count($link)) {
|
||||
$result = mysqli_store_result($link);
|
||||
$num = mysqli_num_rows($result);
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
mysqli_real_query($link, "SELECT * FROM test_result");
|
||||
if (mysqli_field_count($link)) {
|
||||
$result = mysqli_store_result($link);
|
||||
$num = mysqli_num_rows($result);
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
|
||||
var_dump($num);
|
||||
var_dump($num);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_result");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_result");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -38,7 +38,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_result"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+10
-10
@@ -8,19 +8,19 @@ require_once('skipifconnectfailure.inc');
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
mysqli_select_db($link, $db);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_warnings");
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_warnings");
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_warnings");
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_warnings");
|
||||
|
||||
var_dump(mysqli_warning_count($link));
|
||||
var_dump(mysqli_warning_count($link));
|
||||
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -29,7 +29,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_warnings"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+32
-32
@@ -7,46 +7,46 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned,
|
||||
c2 smallint unsigned,
|
||||
c3 smallint,
|
||||
c4 smallint,
|
||||
c5 smallint,
|
||||
c6 smallint unsigned,
|
||||
c7 smallint) ENGINE=" . $engine);
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 smallint unsigned,
|
||||
c2 smallint unsigned,
|
||||
c3 smallint,
|
||||
c4 smallint,
|
||||
c5 smallint,
|
||||
c6 smallint unsigned,
|
||||
c7 smallint) ENGINE=" . $engine);
|
||||
|
||||
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)");
|
||||
mysqli_stmt_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
$stmt = mysqli_prepare($link, "INSERT INTO test_bind_fetch VALUES (?,?,?,?,?,?,?)");
|
||||
mysqli_stmt_bind_param($stmt, "iiiiiii", $c1,$c2,$c3,$c4,$c5,$c6,$c7);
|
||||
|
||||
$c1 = -23;
|
||||
$c2 = 35999;
|
||||
$c3 = NULL;
|
||||
$c4 = -500;
|
||||
$c5 = -9999999;
|
||||
$c6 = -0;
|
||||
$c7 = 0;
|
||||
$c1 = -23;
|
||||
$c2 = 35999;
|
||||
$c3 = NULL;
|
||||
$c4 = -500;
|
||||
$c5 = -9999999;
|
||||
$c6 = -0;
|
||||
$c7 = 0;
|
||||
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
|
||||
$result = mysqli_query($link, "SELECT * FROM test_bind_fetch");
|
||||
$test = mysqli_fetch_object($result);
|
||||
mysqli_free_result($result);
|
||||
$result = mysqli_query($link, "SELECT * FROM test_bind_fetch");
|
||||
$test = mysqli_fetch_object($result);
|
||||
mysqli_free_result($result);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!"
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch");
|
||||
mysqli_close($link);
|
||||
print "done!"
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -55,7 +55,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+23
-23
@@ -7,38 +7,38 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_update");
|
||||
mysqli_query($link,"CREATE TABLE test_update(a varchar(10),
|
||||
b int) ENGINE=" . $engine);
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_update");
|
||||
mysqli_query($link,"CREATE TABLE test_update(a varchar(10),
|
||||
b int) ENGINE=" . $engine);
|
||||
|
||||
mysqli_query($link, "INSERT INTO test_update VALUES ('foo', 2)");
|
||||
mysqli_query($link, "INSERT INTO test_update VALUES ('foo', 2)");
|
||||
|
||||
$stmt = mysqli_prepare($link, "UPDATE test_update SET a=?,b=? WHERE b=?");
|
||||
mysqli_stmt_bind_param($stmt, "sii", $c1, $c2, $c3);
|
||||
$stmt = mysqli_prepare($link, "UPDATE test_update SET a=?,b=? WHERE b=?");
|
||||
mysqli_stmt_bind_param($stmt, "sii", $c1, $c2, $c3);
|
||||
|
||||
$c1 = "Rasmus";
|
||||
$c2 = 1;
|
||||
$c3 = 2;
|
||||
$c1 = "Rasmus";
|
||||
$c2 = 1;
|
||||
$c3 = 2;
|
||||
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
|
||||
$result = mysqli_query($link, "SELECT concat(a, ' is No. ', b) FROM test_update");
|
||||
$test = mysqli_fetch_row($result);
|
||||
mysqli_free_result($result);
|
||||
$result = mysqli_query($link, "SELECT concat(a, ' is No. ', b) FROM test_update");
|
||||
$test = mysqli_fetch_row($result);
|
||||
mysqli_free_result($result);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_update");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_update");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -47,7 +47,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_update"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
@@ -7,19 +7,19 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$i = mysqli_get_server_version($link);
|
||||
$i = mysqli_get_server_version($link);
|
||||
|
||||
$test = $i / $i;
|
||||
$test = $i / $i;
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
|
||||
+24
-24
@@ -2,41 +2,41 @@
|
||||
mysqli_stmt_bind_result (SHOW)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifemb.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifemb.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
|
||||
require_once("connect.inc");
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
require_once("connect.inc");
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
|
||||
mysqli_stmt_execute($stmt);
|
||||
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
|
||||
mysqli_stmt_execute($stmt);
|
||||
|
||||
if (!$stmt->field_count) {
|
||||
printf("skip SHOW command is not supported in prepared statements.");
|
||||
}
|
||||
$stmt->close();
|
||||
mysqli_close($link);
|
||||
if (!$stmt->field_count) {
|
||||
printf("skip SHOW command is not supported in prepared statements.");
|
||||
}
|
||||
$stmt->close();
|
||||
mysqli_close($link);
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
|
||||
mysqli_stmt_execute($stmt);
|
||||
$stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'");
|
||||
mysqli_stmt_execute($stmt);
|
||||
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
$test = array ($c1,$c2);
|
||||
mysqli_stmt_bind_result($stmt, $c1, $c2);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
$test = array ($c1,$c2);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(2) {
|
||||
|
||||
+18
-18
@@ -7,32 +7,32 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_affected");
|
||||
mysqli_query($link, "CREATE TABLE test_affected (foo int) ENGINE=" . $engine);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_affected");
|
||||
mysqli_query($link, "CREATE TABLE test_affected (foo int) ENGINE=" . $engine);
|
||||
|
||||
mysqli_query($link, "INSERT INTO test_affected VALUES (1),(2),(3),(4),(5)");
|
||||
mysqli_query($link, "INSERT INTO test_affected VALUES (1),(2),(3),(4),(5)");
|
||||
|
||||
$stmt = mysqli_prepare($link, "DELETE FROM test_affected WHERE foo=?");
|
||||
mysqli_stmt_bind_param($stmt, "i", $c1);
|
||||
$stmt = mysqli_prepare($link, "DELETE FROM test_affected WHERE foo=?");
|
||||
mysqli_stmt_bind_param($stmt, "i", $c1);
|
||||
|
||||
$c1 = 2;
|
||||
$c1 = 2;
|
||||
|
||||
mysqli_stmt_execute($stmt);
|
||||
$x = mysqli_stmt_affected_rows($stmt);
|
||||
mysqli_stmt_execute($stmt);
|
||||
$x = mysqli_stmt_affected_rows($stmt);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
var_dump($x==1);
|
||||
mysqli_stmt_close($stmt);
|
||||
var_dump($x==1);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_affected");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_affected");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -41,7 +41,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_affected"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+26
-26
@@ -7,43 +7,43 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_affected");
|
||||
mysqli_query($link, "CREATE TABLE test_affected (foo int, bar varchar(10) character set latin1) ENGINE=" . $engine);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_affected");
|
||||
mysqli_query($link, "CREATE TABLE test_affected (foo int, bar varchar(10) character set latin1) ENGINE=" . $engine);
|
||||
|
||||
mysqli_query($link, "INSERT INTO test_affected VALUES (1, 'Zak'),(2, 'Greant')");
|
||||
mysqli_query($link, "INSERT INTO test_affected VALUES (1, 'Zak'),(2, 'Greant')");
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_affected");
|
||||
mysqli_stmt_execute($stmt);
|
||||
$result = mysqli_stmt_result_metadata($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_affected");
|
||||
mysqli_stmt_execute($stmt);
|
||||
$result = mysqli_stmt_result_metadata($stmt);
|
||||
|
||||
echo "\n=== fetch_fields ===\n";
|
||||
var_dump(mysqli_fetch_fields($result));
|
||||
echo "\n=== fetch_fields ===\n";
|
||||
var_dump(mysqli_fetch_fields($result));
|
||||
|
||||
echo "\n=== fetch_field_direct ===\n";
|
||||
var_dump(mysqli_fetch_field_direct($result, 0));
|
||||
var_dump(mysqli_fetch_field_direct($result, 1));
|
||||
echo "\n=== fetch_field_direct ===\n";
|
||||
var_dump(mysqli_fetch_field_direct($result, 0));
|
||||
var_dump(mysqli_fetch_field_direct($result, 1));
|
||||
|
||||
echo "\n=== fetch_field ===\n";
|
||||
while ($field = mysqli_fetch_field($result)) {
|
||||
var_dump($field);
|
||||
}
|
||||
echo "\n=== fetch_field ===\n";
|
||||
while ($field = mysqli_fetch_field($result)) {
|
||||
var_dump($field);
|
||||
}
|
||||
|
||||
print_r(mysqli_fetch_lengths($result));
|
||||
print_r(mysqli_fetch_lengths($result));
|
||||
|
||||
mysqli_free_result($result);
|
||||
mysqli_free_result($result);
|
||||
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_affected");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_query($link, "DROP TABLE IF EXISTS test_affected");
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -52,7 +52,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_affected"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+24
-24
@@ -7,38 +7,38 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$mysql = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$mysql = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$mysql->select_db($db);
|
||||
$mysql->query("DROP TABLE IF EXISTS test_fetch_null");
|
||||
$mysql->select_db($db);
|
||||
$mysql->query("DROP TABLE IF EXISTS test_fetch_null");
|
||||
|
||||
$mysql->query("CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint,
|
||||
col3 int, col4 bigint,
|
||||
col5 float, col6 double,
|
||||
col7 date, col8 time,
|
||||
col9 varbinary(10),
|
||||
col10 varchar(50),
|
||||
col11 char(20)) ENGINE=" . $engine);
|
||||
$mysql->query("CREATE TABLE test_fetch_null(col1 tinyint, col2 smallint,
|
||||
col3 int, col4 bigint,
|
||||
col5 float, col6 double,
|
||||
col7 date, col8 time,
|
||||
col9 varbinary(10),
|
||||
col10 varchar(50),
|
||||
col11 char(20)) ENGINE=" . $engine);
|
||||
|
||||
$mysql->query("INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)");
|
||||
$mysql->query("INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)");
|
||||
|
||||
$stmt = $mysql->prepare("SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null");
|
||||
$stmt->bind_result($c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
|
||||
$stmt->execute();
|
||||
$stmt = $mysql->prepare("SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null");
|
||||
$stmt->bind_result($c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11);
|
||||
$stmt->execute();
|
||||
|
||||
$stmt->fetch();
|
||||
$stmt->fetch();
|
||||
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11);
|
||||
$test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
$stmt->close();
|
||||
$mysql->query("DROP TABLE IF EXISTS test_fetch_null");
|
||||
$mysql->close();
|
||||
print "done!";
|
||||
$stmt->close();
|
||||
$mysql->query("DROP TABLE IF EXISTS test_fetch_null");
|
||||
$mysql->close();
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -47,7 +47,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+12
-12
@@ -8,22 +8,22 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$mysql = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$mysql = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$mysql->select_db($db);
|
||||
$result = $mysql->query("SELECT DATABASE()");
|
||||
$row = $result->fetch_row();
|
||||
$result->close();
|
||||
$mysql->select_db($db);
|
||||
$result = $mysql->query("SELECT DATABASE()");
|
||||
$row = $result->fetch_row();
|
||||
$result->close();
|
||||
|
||||
var_dump($row);
|
||||
if ($row[0] != $db)
|
||||
printf("[001] Expecting '%s' got '%s'\n", $db, $row[0]);
|
||||
var_dump($row);
|
||||
if ($row[0] != $db)
|
||||
printf("[001] Expecting '%s' got '%s'\n", $db, $row[0]);
|
||||
|
||||
$mysql->close();
|
||||
print "done!";
|
||||
$mysql->close();
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(1) {
|
||||
|
||||
@@ -7,18 +7,18 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/************************
|
||||
* non freed stamement
|
||||
************************/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/************************
|
||||
* non freed stamement
|
||||
************************/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT CURRENT_USER()");
|
||||
mysqli_stmt_execute($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT CURRENT_USER()");
|
||||
mysqli_stmt_execute($stmt);
|
||||
|
||||
mysqli_close($link);
|
||||
printf("Ok\n");
|
||||
mysqli_close($link);
|
||||
printf("Ok\n");
|
||||
?>
|
||||
--EXPECT--
|
||||
Ok
|
||||
+10
-10
@@ -7,19 +7,19 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/************************
|
||||
* free statement after close
|
||||
************************/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/************************
|
||||
* free statement after close
|
||||
************************/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$stmt1 = mysqli_prepare($link, "SELECT CURRENT_USER()");
|
||||
mysqli_stmt_execute($stmt1);
|
||||
$stmt1 = mysqli_prepare($link, "SELECT CURRENT_USER()");
|
||||
mysqli_stmt_execute($stmt1);
|
||||
|
||||
mysqli_close($link);
|
||||
@mysqli_stmt_close($stmt1);
|
||||
printf("Ok\n");
|
||||
mysqli_close($link);
|
||||
@mysqli_stmt_close($stmt1);
|
||||
printf("Ok\n");
|
||||
?>
|
||||
--EXPECT--
|
||||
Ok
|
||||
+10
-10
@@ -7,19 +7,19 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/************************
|
||||
* statement call after close
|
||||
************************/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/************************
|
||||
* statement call after close
|
||||
************************/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()");
|
||||
$stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()");
|
||||
|
||||
mysqli_close($link);
|
||||
@mysqli_stmt_execute($stmt2);
|
||||
@mysqli_stmt_close($stmt2);
|
||||
printf("Ok\n");
|
||||
mysqli_close($link);
|
||||
@mysqli_stmt_execute($stmt2);
|
||||
@mysqli_stmt_close($stmt2);
|
||||
printf("Ok\n");
|
||||
?>
|
||||
--EXPECT--
|
||||
Ok
|
||||
@@ -7,16 +7,16 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/************************
|
||||
* non freed resultset
|
||||
************************/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/************************
|
||||
* non freed resultset
|
||||
************************/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$result = mysqli_query($link, "SELECT CURRENT_USER()");
|
||||
mysqli_close($link);
|
||||
printf("Ok\n");
|
||||
$result = mysqli_query($link, "SELECT CURRENT_USER()");
|
||||
mysqli_close($link);
|
||||
printf("Ok\n");
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
|
||||
@@ -7,17 +7,17 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/************************
|
||||
* free resultset after close
|
||||
************************/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/************************
|
||||
* free resultset after close
|
||||
************************/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$result1 = mysqli_query($link, "SELECT CURRENT_USER()");
|
||||
mysqli_close($link);
|
||||
mysqli_free_result($result1);
|
||||
printf("Ok\n");
|
||||
$result1 = mysqli_query($link, "SELECT CURRENT_USER()");
|
||||
mysqli_close($link);
|
||||
mysqli_free_result($result1);
|
||||
printf("Ok\n");
|
||||
?>
|
||||
--EXPECT--
|
||||
Ok
|
||||
@@ -7,16 +7,16 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/************************
|
||||
* don't free anything
|
||||
************************/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/************************
|
||||
* don't free anything
|
||||
************************/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$result2 = mysqli_query($link, "SELECT CURRENT_USER()");
|
||||
$stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()");
|
||||
printf("Ok\n");
|
||||
$result2 = mysqli_query($link, "SELECT CURRENT_USER()");
|
||||
$stmt2 = mysqli_prepare($link, "SELECT CURRENT_USER()");
|
||||
printf("Ok\n");
|
||||
?>
|
||||
--EXPECT--
|
||||
Ok
|
||||
+10
-10
@@ -7,18 +7,18 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
class foobar extends mysqli {
|
||||
function test () {
|
||||
return ("I do not like MySQL 4.1");
|
||||
}
|
||||
}
|
||||
class foobar extends mysqli {
|
||||
function test () {
|
||||
return ("I do not like MySQL 4.1");
|
||||
}
|
||||
}
|
||||
|
||||
$foo = new foobar();
|
||||
$foo->connect($host, $user, $passwd, $db, $port, $socket);
|
||||
$foo->close();
|
||||
printf("%s\n", $foo->test());
|
||||
$foo = new foobar();
|
||||
$foo->connect($host, $user, $passwd, $db, $port, $socket);
|
||||
$foo->close();
|
||||
printf("%s\n", $foo->test());
|
||||
?>
|
||||
--EXPECT--
|
||||
I do not like MySQL 4.1
|
||||
+41
-41
@@ -7,60 +7,60 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_store_result");
|
||||
mysqli_query($link,"CREATE TABLE test_store_result (a int)");
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_store_result");
|
||||
mysqli_query($link,"CREATE TABLE test_store_result (a int)");
|
||||
|
||||
mysqli_query($link, "INSERT INTO test_store_result VALUES (1),(2),(3)");
|
||||
mysqli_query($link, "INSERT INTO test_store_result VALUES (1),(2),(3)");
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_store_result");
|
||||
mysqli_stmt_execute($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_store_result");
|
||||
mysqli_stmt_execute($stmt);
|
||||
|
||||
/* this should produce an out of sync error */
|
||||
if ($result = mysqli_query($link, "SELECT * FROM test_store_result")) {
|
||||
mysqli_free_result($result);
|
||||
printf ("Query ok\n");
|
||||
}
|
||||
mysqli_stmt_close($stmt);
|
||||
/* this should produce an out of sync error */
|
||||
if ($result = mysqli_query($link, "SELECT * FROM test_store_result")) {
|
||||
mysqli_free_result($result);
|
||||
printf ("Query ok\n");
|
||||
}
|
||||
mysqli_stmt_close($stmt);
|
||||
|
||||
/* now we should try mysqli_stmt_reset() */
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_store_result");
|
||||
var_dump(mysqli_stmt_execute($stmt));
|
||||
var_dump(mysqli_stmt_reset($stmt));
|
||||
/* now we should try mysqli_stmt_reset() */
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_store_result");
|
||||
var_dump(mysqli_stmt_execute($stmt));
|
||||
var_dump(mysqli_stmt_reset($stmt));
|
||||
|
||||
var_dump($stmt = mysqli_prepare($link, "SELECT * FROM test_store_result"));
|
||||
if ($stmt->affected_rows !== 0)
|
||||
printf("[001] Expecting 0, got %d\n", $stmt->affected_rows);
|
||||
var_dump($stmt = mysqli_prepare($link, "SELECT * FROM test_store_result"));
|
||||
if ($stmt->affected_rows !== 0)
|
||||
printf("[001] Expecting 0, got %d\n", $stmt->affected_rows);
|
||||
|
||||
var_dump(mysqli_stmt_execute($stmt));
|
||||
var_dump($stmt = @mysqli_prepare($link, "SELECT * FROM test_store_result"), mysqli_error($link));
|
||||
var_dump(mysqli_stmt_reset($stmt));
|
||||
var_dump(mysqli_stmt_execute($stmt));
|
||||
var_dump($stmt = @mysqli_prepare($link, "SELECT * FROM test_store_result"), mysqli_error($link));
|
||||
var_dump(mysqli_stmt_reset($stmt));
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_store_result");
|
||||
mysqli_stmt_execute($stmt);
|
||||
$result1 = mysqli_stmt_result_metadata($stmt);
|
||||
mysqli_stmt_store_result($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM test_store_result");
|
||||
mysqli_stmt_execute($stmt);
|
||||
$result1 = mysqli_stmt_result_metadata($stmt);
|
||||
mysqli_stmt_store_result($stmt);
|
||||
|
||||
printf ("Rows: %d\n", mysqli_stmt_affected_rows($stmt));
|
||||
printf ("Rows: %d\n", mysqli_stmt_affected_rows($stmt));
|
||||
|
||||
/* this should show an error, cause results are not buffered */
|
||||
if ($result = mysqli_query($link, "SELECT * FROM test_store_result")) {
|
||||
$row = mysqli_fetch_row($result);
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
/* this should show an error, cause results are not buffered */
|
||||
if ($result = mysqli_query($link, "SELECT * FROM test_store_result")) {
|
||||
$row = mysqli_fetch_row($result);
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
|
||||
var_dump($row);
|
||||
var_dump($row);
|
||||
|
||||
mysqli_free_result($result1);
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_close($link);
|
||||
echo "done!";
|
||||
mysqli_free_result($result1);
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_close($link);
|
||||
echo "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -69,7 +69,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_store_result"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+26
-26
@@ -7,46 +7,46 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS mbind");
|
||||
mysqli_query($link,"CREATE TABLE mbind (a int, b varchar(10))");
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS mbind");
|
||||
mysqli_query($link,"CREATE TABLE mbind (a int, b varchar(10))");
|
||||
|
||||
$stmt = mysqli_prepare($link, "INSERT INTO mbind VALUES (?,?)");
|
||||
$stmt = mysqli_prepare($link, "INSERT INTO mbind VALUES (?,?)");
|
||||
|
||||
mysqli_stmt_bind_param($stmt, "is", $a, $b);
|
||||
mysqli_stmt_bind_param($stmt, "is", $a, $b);
|
||||
|
||||
$a = 1;
|
||||
$b = "foo";
|
||||
$a = 1;
|
||||
$b = "foo";
|
||||
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_execute($stmt);
|
||||
|
||||
mysqli_stmt_bind_param($stmt, "is", $c, $d);
|
||||
mysqli_stmt_bind_param($stmt, "is", $c, $d);
|
||||
|
||||
$c = 2;
|
||||
$d = "bar";
|
||||
$c = 2;
|
||||
$d = "bar";
|
||||
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM mbind");
|
||||
mysqli_stmt_execute($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM mbind");
|
||||
mysqli_stmt_execute($stmt);
|
||||
|
||||
mysqli_stmt_bind_result($stmt, $e, $f);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
mysqli_stmt_bind_result($stmt, $e, $f);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
mysqli_stmt_bind_result($stmt, $g, $h);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
mysqli_stmt_bind_result($stmt, $g, $h);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
var_dump((array($e,$f,$g,$h)));
|
||||
var_dump((array($e,$f,$g,$h)));
|
||||
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -55,7 +55,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS mbind"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+21
-21
@@ -7,39 +7,39 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_select_db($link, $db);
|
||||
|
||||
mysqli_query($link, "SET SQL_MODE='PIPES_AS_CONCAT'");
|
||||
mysqli_query($link, "SET SQL_MODE='PIPES_AS_CONCAT'");
|
||||
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS mbind");
|
||||
mysqli_query($link,"CREATE TABLE mbind (b varchar(25))");
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS mbind");
|
||||
mysqli_query($link,"CREATE TABLE mbind (b varchar(25))");
|
||||
|
||||
$stmt = mysqli_prepare($link, "INSERT INTO mbind VALUES (?||?)");
|
||||
$stmt = mysqli_prepare($link, "INSERT INTO mbind VALUES (?||?)");
|
||||
|
||||
mysqli_stmt_bind_param($stmt, "ss", $a, $b);
|
||||
mysqli_stmt_bind_param($stmt, "ss", $a, $b);
|
||||
|
||||
$a = "foo";
|
||||
$b = "bar";
|
||||
$a = "foo";
|
||||
$b = "bar";
|
||||
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_execute($stmt);
|
||||
|
||||
mysqli_stmt_close($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM mbind");
|
||||
mysqli_stmt_execute($stmt);
|
||||
$stmt = mysqli_prepare($link, "SELECT * FROM mbind");
|
||||
mysqli_stmt_execute($stmt);
|
||||
|
||||
mysqli_stmt_bind_result($stmt, $e);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
mysqli_stmt_bind_result($stmt, $e);
|
||||
mysqli_stmt_fetch($stmt);
|
||||
|
||||
var_dump($e);
|
||||
var_dump($e);
|
||||
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
mysqli_close($link);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -48,7 +48,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS mbind"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+26
-26
@@ -7,40 +7,40 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
class test_class {
|
||||
function __construct($arg1, $arg2) {
|
||||
echo __METHOD__ . "($arg1,$arg2)\n";
|
||||
}
|
||||
}
|
||||
class test_class {
|
||||
function __construct($arg1, $arg2) {
|
||||
echo __METHOD__ . "($arg1,$arg2)\n";
|
||||
}
|
||||
}
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
mysqli_select_db($link, $db);
|
||||
mysqli_query($link, "SET sql_mode=''");
|
||||
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_fetch");
|
||||
mysqli_query($link,"CREATE TABLE test_fetch(c1 smallint unsigned,
|
||||
c2 smallint unsigned,
|
||||
c3 smallint,
|
||||
c4 smallint,
|
||||
c5 smallint,
|
||||
c6 smallint unsigned,
|
||||
c7 smallint)");
|
||||
mysqli_query($link,"DROP TABLE IF EXISTS test_fetch");
|
||||
mysqli_query($link,"CREATE TABLE test_fetch(c1 smallint unsigned,
|
||||
c2 smallint unsigned,
|
||||
c3 smallint,
|
||||
c4 smallint,
|
||||
c5 smallint,
|
||||
c6 smallint unsigned,
|
||||
c7 smallint)");
|
||||
|
||||
mysqli_query($link, "INSERT INTO test_fetch VALUES ( -23, 35999, NULL, -500, -9999999, -0, 0)");
|
||||
mysqli_query($link, "INSERT INTO test_fetch VALUES ( -23, 35999, NULL, -500, -9999999, -0, 0)");
|
||||
|
||||
$result = mysqli_query($link, "SELECT * FROM test_fetch");
|
||||
$test = mysqli_fetch_object($result, 'test_class', array(1, 2));
|
||||
mysqli_free_result($result);
|
||||
$result = mysqli_query($link, "SELECT * FROM test_fetch");
|
||||
$test = mysqli_fetch_object($result, 'test_class', array(1, 2));
|
||||
mysqli_free_result($result);
|
||||
|
||||
var_dump($test);
|
||||
var_dump($test);
|
||||
|
||||
mysqli_close($link);
|
||||
mysqli_close($link);
|
||||
|
||||
echo "Done\n";
|
||||
echo "Done\n";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -49,7 +49,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+35
-35
@@ -5,15 +5,15 @@ local infile handler
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
if (!function_exists('mysqli_set_local_infile_handler'))
|
||||
die("skip - function not available.");
|
||||
die("skip - function not available.");
|
||||
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
if (!$link)
|
||||
die(sprintf("skip Can't connect [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
|
||||
die(sprintf("skip Can't connect [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
|
||||
|
||||
include_once("local_infile_tools.inc");
|
||||
if ($msg = check_local_infile_support($link, $engine))
|
||||
die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
|
||||
die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
@@ -21,45 +21,45 @@ mysqli_close($link);
|
||||
mysqli.allow_local_infile=1
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
function my_read($fp, &$buffer, $buflen, &$error) {
|
||||
$buffer = strrev(fread($fp, $buflen));
|
||||
return(strlen($buffer));
|
||||
}
|
||||
function my_read($fp, &$buffer, $buflen, &$error) {
|
||||
$buffer = strrev(fread($fp, $buflen));
|
||||
return(strlen($buffer));
|
||||
}
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
/* create temporary file */
|
||||
$filename = __DIR__ . "061.csv";
|
||||
$fp = fopen($filename, "w");
|
||||
fwrite($fp, "foo;bar");
|
||||
fclose($fp);
|
||||
/* create temporary file */
|
||||
$filename = __DIR__ . "061.csv";
|
||||
$fp = fopen($filename, "w");
|
||||
fwrite($fp, "foo;bar");
|
||||
fclose($fp);
|
||||
|
||||
if (!mysqli_query($link,"DROP TABLE IF EXISTS t_061"))
|
||||
printf("Cannot drop table: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link,"CREATE TABLE t_061 (c1 varchar(10), c2 varchar(10))"))
|
||||
printf("Cannot create table: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link,"DROP TABLE IF EXISTS t_061"))
|
||||
printf("Cannot drop table: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link,"CREATE TABLE t_061 (c1 varchar(10), c2 varchar(10))"))
|
||||
printf("Cannot create table: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if (!mysqli_query($link, sprintf("LOAD DATA LOCAL INFILE '%s' INTO TABLE t_061 FIELDS TERMINATED BY ';'", mysqli_real_escape_string($link, $filename))))
|
||||
printf("Cannot load data: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, sprintf("LOAD DATA LOCAL INFILE '%s' INTO TABLE t_061 FIELDS TERMINATED BY ';'", mysqli_real_escape_string($link, $filename))))
|
||||
printf("Cannot load data: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_set_local_infile_handler($link, "my_read");
|
||||
if (!mysqli_query($link, sprintf("LOAD DATA LOCAL INFILE '%s' INTO TABLE t_061 FIELDS TERMINATED BY ';'", mysqli_real_escape_string($link, $filename))))
|
||||
printf("Cannot load data using infile handler: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
mysqli_set_local_infile_handler($link, "my_read");
|
||||
if (!mysqli_query($link, sprintf("LOAD DATA LOCAL INFILE '%s' INTO TABLE t_061 FIELDS TERMINATED BY ';'", mysqli_real_escape_string($link, $filename))))
|
||||
printf("Cannot load data using infile handler: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
if ($result = mysqli_query($link, "SELECT c1,c2 FROM t_061")) {
|
||||
while (($row = mysqli_fetch_row($result))) {
|
||||
printf("%s-%s\n", $row[0], $row[1]);
|
||||
printf("%s-%s\n", gettype($row[0]), gettype($row[1]));
|
||||
}
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
if ($result = mysqli_query($link, "SELECT c1,c2 FROM t_061")) {
|
||||
while (($row = mysqli_fetch_row($result))) {
|
||||
printf("%s-%s\n", $row[0], $row[1]);
|
||||
printf("%s-%s\n", gettype($row[0]), gettype($row[1]));
|
||||
}
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
|
||||
mysqli_close($link);
|
||||
unlink($filename);
|
||||
print "done!";
|
||||
mysqli_close($link);
|
||||
unlink($filename);
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -68,7 +68,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS t_061"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
@@ -7,20 +7,20 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$mysql->real_query("SELECT 'foo' FROM DUAL");
|
||||
$mysql->real_query("SELECT 'foo' FROM DUAL");
|
||||
|
||||
$myresult = new mysqli_result($mysql);
|
||||
$myresult = new mysqli_result($mysql);
|
||||
|
||||
$row = $myresult->fetch_row();
|
||||
$myresult->close();
|
||||
$mysql->close();
|
||||
$row = $myresult->fetch_row();
|
||||
$myresult->close();
|
||||
$mysql->close();
|
||||
|
||||
var_dump($row);
|
||||
print "done!";
|
||||
var_dump($row);
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
|
||||
@@ -7,18 +7,27 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$stmt = new mysqli_stmt($mysql, "SELECT 'foo' FROM DUAL");
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($foo);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
$mysql->close();
|
||||
$stmt = new mysqli_stmt($mysql, "SELECT 'foo' FROM DUAL");
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($foo);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
var_dump($foo);
|
||||
|
||||
var_dump($foo);
|
||||
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
|
||||
try {
|
||||
// an exception should be thrown from prepare (i.e. constructor) not from execute
|
||||
$stmt = new mysqli_stmt($mysql, "SELECT invalid FROM DUAL");
|
||||
} catch(mysqli_sql_exception $e) {
|
||||
echo $e->getMessage()."\n";
|
||||
}
|
||||
|
||||
$mysql->close();
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "foo"
|
||||
Unknown column 'invalid' in 'field list'
|
||||
@@ -7,18 +7,18 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$stmt = new mysqli_stmt($mysql, "SELECT NULL FROM DUAL");
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($foo);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
$mysql->close();
|
||||
$stmt = new mysqli_stmt($mysql, "SELECT NULL FROM DUAL");
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($foo);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
$mysql->close();
|
||||
|
||||
var_dump($foo);
|
||||
var_dump($foo);
|
||||
?>
|
||||
--EXPECT--
|
||||
NULL
|
||||
+28
-28
@@ -6,47 +6,47 @@ require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
|
||||
if (!function_exists('mysqli_set_charset')) {
|
||||
die('skip mysqli_set_charset() not available');
|
||||
die('skip mysqli_set_charset() not available');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
if (!$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
if (!$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($mysql, "SET sql_mode=''"))
|
||||
printf("[002] Cannot set SQL-Mode, [%d] %s\n", mysqli_errno($mysql), mysqli_error($mysql));
|
||||
if (!mysqli_query($mysql, "SET sql_mode=''"))
|
||||
printf("[002] Cannot set SQL-Mode, [%d] %s\n", mysqli_errno($mysql), mysqli_error($mysql));
|
||||
|
||||
$esc_str = chr(0xbf) . chr(0x5c);
|
||||
$len = $charset = array();
|
||||
$tmp = null;
|
||||
$esc_str = chr(0xbf) . chr(0x5c);
|
||||
$len = $charset = array();
|
||||
$tmp = null;
|
||||
|
||||
if ($mysql->set_charset("latin1")) {
|
||||
/* 5C should be escaped */
|
||||
if (3 !== ($tmp = strlen($mysql->real_escape_string($esc_str))))
|
||||
printf("[003] Expecting 3/int got %s/%s\n", gettype($tmp), $tmp);
|
||||
if ($mysql->set_charset("latin1")) {
|
||||
/* 5C should be escaped */
|
||||
if (3 !== ($tmp = strlen($mysql->real_escape_string($esc_str))))
|
||||
printf("[003] Expecting 3/int got %s/%s\n", gettype($tmp), $tmp);
|
||||
|
||||
if ('latin1' !== ($tmp = $mysql->character_set_name()))
|
||||
printf("[004] Expecting latin1/string got %s/%s\n", gettype($tmp), $tmp);
|
||||
}
|
||||
if ('latin1' !== ($tmp = $mysql->character_set_name()))
|
||||
printf("[004] Expecting latin1/string got %s/%s\n", gettype($tmp), $tmp);
|
||||
}
|
||||
|
||||
if ($res = $mysql->query("SHOW CHARACTER SET LIKE 'gbk'")) {
|
||||
$res->free_result();
|
||||
if ($mysql->set_charset("gbk")) {
|
||||
/* nothing should be escaped, it's a valid gbk character */
|
||||
if ($res = $mysql->query("SHOW CHARACTER SET LIKE 'gbk'")) {
|
||||
$res->free_result();
|
||||
if ($mysql->set_charset("gbk")) {
|
||||
/* nothing should be escaped, it's a valid gbk character */
|
||||
|
||||
if (2 !== ($tmp = strlen($mysql->real_escape_string($esc_str))))
|
||||
printf("[005] Expecting 2/int got %s/%s\n", gettype($tmp), $tmp);
|
||||
if (2 !== ($tmp = strlen($mysql->real_escape_string($esc_str))))
|
||||
printf("[005] Expecting 2/int got %s/%s\n", gettype($tmp), $tmp);
|
||||
|
||||
if ('gbk' !== ($tmp = $mysql->character_set_name()))
|
||||
printf("[005] Expecting gbk/string got %s/%s\n", gettype($tmp), $tmp);
|
||||
}
|
||||
}
|
||||
$mysql->close();
|
||||
if ('gbk' !== ($tmp = $mysql->character_set_name()))
|
||||
printf("[005] Expecting gbk/string got %s/%s\n", gettype($tmp), $tmp);
|
||||
}
|
||||
}
|
||||
$mysql->close();
|
||||
|
||||
print "done!";
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECT--
|
||||
done!
|
||||
+16
-16
@@ -7,28 +7,28 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
/*** test mysqli_connect 127.0.0.1 ***/
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
if (!mysqli_query($mysql, "SET sql_mode=''"))
|
||||
printf("[002] Cannot set SQL-Mode, [%d] %s\n", mysqli_errno($mysql), mysqli_error($mysql));
|
||||
if (!mysqli_query($mysql, "SET sql_mode=''"))
|
||||
printf("[002] Cannot set SQL-Mode, [%d] %s\n", mysqli_errno($mysql), mysqli_error($mysql));
|
||||
|
||||
$mysql->query("DROP TABLE IF EXISTS test_warnings");
|
||||
$mysql->query("DROP TABLE IF EXISTS test_warnings");
|
||||
|
||||
$mysql->query("CREATE TABLE test_warnings (a int not null) ENGINE=myisam");
|
||||
$mysql->query("CREATE TABLE test_warnings (a int not null) ENGINE=myisam");
|
||||
|
||||
$mysql->query("INSERT INTO test_warnings VALUES (1),(2),(NULL)");
|
||||
$mysql->query("INSERT INTO test_warnings VALUES (1),(2),(NULL)");
|
||||
|
||||
if (($warning = $mysql->get_warnings())) {
|
||||
do {
|
||||
printf("Warning\n");
|
||||
} while ($warning->next());
|
||||
}
|
||||
if (($warning = $mysql->get_warnings())) {
|
||||
do {
|
||||
printf("Warning\n");
|
||||
} while ($warning->next());
|
||||
}
|
||||
|
||||
$mysql->close();
|
||||
print "done!";
|
||||
$mysql->close();
|
||||
print "done!";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -37,7 +37,7 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_warnings"))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
|
||||
+49
-49
@@ -2,67 +2,67 @@
|
||||
function test: nested selects (cursors)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
require_once("connect.inc");
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
require_once("connect.inc");
|
||||
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
die("skip Cannot connect to check required version");
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
die("skip Cannot connect to check required version");
|
||||
|
||||
/* skip cursor test for versions < 50004 */
|
||||
if ((!$IS_MYSQLND && (mysqli_get_client_version() < 50009)) ||
|
||||
(mysqli_get_server_version($link) < 50009)) {
|
||||
die(sprintf("skip Client library doesn't support cursors (%s/%s)",
|
||||
mysqli_get_client_version(), mysqli_get_server_version($link)));
|
||||
}
|
||||
mysqli_close($link);
|
||||
/* skip cursor test for versions < 50004 */
|
||||
if ((!$IS_MYSQLND && (mysqli_get_client_version() < 50009)) ||
|
||||
(mysqli_get_server_version($link) < 50009)) {
|
||||
die(sprintf("skip Client library doesn't support cursors (%s/%s)",
|
||||
mysqli_get_client_version(), mysqli_get_server_version($link)));
|
||||
}
|
||||
mysqli_close($link);
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
function open_cursor($mysql, $query) {
|
||||
if (!is_object($stmt = $mysql->prepare($query))) {
|
||||
printf("[001] Cannot create statement object for '%s', [%d] %s\n",
|
||||
$query, $mysql->errno, $mysql->error);
|
||||
}
|
||||
function open_cursor($mysql, $query) {
|
||||
if (!is_object($stmt = $mysql->prepare($query))) {
|
||||
printf("[001] Cannot create statement object for '%s', [%d] %s\n",
|
||||
$query, $mysql->errno, $mysql->error);
|
||||
}
|
||||
|
||||
$stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_READ_ONLY);
|
||||
return $stmt;
|
||||
}
|
||||
$stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_READ_ONLY);
|
||||
return $stmt;
|
||||
}
|
||||
|
||||
require_once("connect.inc");
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
require_once("connect.inc");
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
if ((!$IS_MYSQLND && mysqli_get_client_version() < 50009) ||
|
||||
(mysqli_get_server_version($mysql) < 50009)) {
|
||||
/* we really want to skip it... */
|
||||
die(var_dump(63));
|
||||
}
|
||||
if ((!$IS_MYSQLND && mysqli_get_client_version() < 50009) ||
|
||||
(mysqli_get_server_version($mysql) < 50009)) {
|
||||
/* we really want to skip it... */
|
||||
die(var_dump(63));
|
||||
}
|
||||
|
||||
$a = array();
|
||||
$a = array();
|
||||
|
||||
for ($i=0;$i < 3; $i++) {
|
||||
$mysql->query("DROP TABLE IF EXISTS cursor$i");
|
||||
$mysql->query("CREATE TABLE cursor$i (a int not null) ENGINE=" . $engine);
|
||||
$mysql->query("INSERT INTO cursor$i VALUES (1),(2),(3),(4),(5),(6)");
|
||||
$stmt[$i] = open_cursor($mysql, "SELECT a FROM cursor$i");
|
||||
$stmt[$i]->execute();
|
||||
$stmt[$i]->bind_result($a[$i]);
|
||||
}
|
||||
for ($i=0;$i < 3; $i++) {
|
||||
$mysql->query("DROP TABLE IF EXISTS cursor$i");
|
||||
$mysql->query("CREATE TABLE cursor$i (a int not null) ENGINE=" . $engine);
|
||||
$mysql->query("INSERT INTO cursor$i VALUES (1),(2),(3),(4),(5),(6)");
|
||||
$stmt[$i] = open_cursor($mysql, "SELECT a FROM cursor$i");
|
||||
$stmt[$i]->execute();
|
||||
$stmt[$i]->bind_result($a[$i]);
|
||||
}
|
||||
|
||||
|
||||
$cnt = 0;
|
||||
while ($stmt[0]->fetch()) {
|
||||
$stmt[1]->fetch();
|
||||
$stmt[2]->fetch();
|
||||
$cnt += $a[0] + $a[1] + $a[2];
|
||||
}
|
||||
$cnt = 0;
|
||||
while ($stmt[0]->fetch()) {
|
||||
$stmt[1]->fetch();
|
||||
$stmt[2]->fetch();
|
||||
$cnt += $a[0] + $a[1] + $a[2];
|
||||
}
|
||||
|
||||
for ($i=0; $i < 3; $i++) {
|
||||
$stmt[$i]->close();
|
||||
}
|
||||
for ($i=0; $i < 3; $i++) {
|
||||
$stmt[$i]->close();
|
||||
}
|
||||
|
||||
$mysql->close();
|
||||
var_dump($cnt);
|
||||
$mysql->close();
|
||||
var_dump($cnt);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@@ -71,8 +71,8 @@ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
for ($i =0; $i < 3; $i++) {
|
||||
if (!mysqli_query($link, sprintf("DROP TABLE IF EXISTS cursor%d", $i)))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
if (!mysqli_query($link, sprintf("DROP TABLE IF EXISTS cursor%d", $i)))
|
||||
printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
|
||||
}
|
||||
|
||||
mysqli_close($link);
|
||||
|
||||
@@ -4,8 +4,8 @@ mysqli get_client_info
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$s = mysqli_get_client_info();
|
||||
echo gettype($s);
|
||||
$s = mysqli_get_client_info();
|
||||
echo gettype($s);
|
||||
?>
|
||||
--EXPECT--
|
||||
string
|
||||
+17
-17
@@ -7,24 +7,24 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
$mysql->multi_query('SELECT 1;SELECT 2');
|
||||
do {
|
||||
$res = $mysql->store_result();
|
||||
if ($mysql->errno == 0) {
|
||||
while ($arr = $res->fetch_assoc()) {
|
||||
var_dump($arr);
|
||||
}
|
||||
$res->free();
|
||||
}
|
||||
if (!$mysql->more_results()) {
|
||||
break;
|
||||
}
|
||||
} while (@$mysql->next_result());
|
||||
$mysql->close();
|
||||
print "done!";
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
$mysql->multi_query('SELECT 1;SELECT 2');
|
||||
do {
|
||||
$res = $mysql->store_result();
|
||||
if ($mysql->errno == 0) {
|
||||
while ($arr = $res->fetch_assoc()) {
|
||||
var_dump($arr);
|
||||
}
|
||||
$res->free();
|
||||
}
|
||||
if (!$mysql->more_results()) {
|
||||
break;
|
||||
}
|
||||
} while (@$mysql->next_result());
|
||||
$mysql->close();
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
|
||||
@@ -7,12 +7,12 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
var_dump($mysql->ping());
|
||||
$mysql->close();
|
||||
print "done!";
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
var_dump($mysql->ping());
|
||||
$mysql->close();
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
|
||||
+47
-47
@@ -8,63 +8,63 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
$version = $mysql->server_version;
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
$version = $mysql->server_version;
|
||||
|
||||
var_dump($mysql->ping());
|
||||
var_dump($mysql->ping());
|
||||
|
||||
$ret = $mysql->kill($mysql->thread_id);
|
||||
if ($IS_MYSQLND) {
|
||||
if ($ret !== true){
|
||||
printf("[001] Expecting boolean/true got %s/%s\n", gettype($ret), var_export($ret, true));
|
||||
}
|
||||
} else {
|
||||
/* libmysql return value seems to depend on server version */
|
||||
if ((($version >= 50123) || ($version <= 40200)) && $version != 50200) {
|
||||
/* TODO: find exact version */
|
||||
if ($ret !== true){
|
||||
printf("[001] Expecting boolean/true got %s/%s @\n", gettype($ret), var_export($ret, true), $version);
|
||||
}
|
||||
} else {
|
||||
if ($ret !== false){
|
||||
printf("[001] Expecting boolean/false got %s/%s @\n", gettype($ret), var_export($ret, true), $version);
|
||||
}
|
||||
}
|
||||
}
|
||||
$ret = $mysql->kill($mysql->thread_id);
|
||||
if ($IS_MYSQLND) {
|
||||
if ($ret !== true){
|
||||
printf("[001] Expecting boolean/true got %s/%s\n", gettype($ret), var_export($ret, true));
|
||||
}
|
||||
} else {
|
||||
/* libmysql return value seems to depend on server version */
|
||||
if ((($version >= 50123) || ($version <= 40200)) && $version != 50200) {
|
||||
/* TODO: find exact version */
|
||||
if ($ret !== true){
|
||||
printf("[001] Expecting boolean/true got %s/%s @\n", gettype($ret), var_export($ret, true), $version);
|
||||
}
|
||||
} else {
|
||||
if ($ret !== false){
|
||||
printf("[001] Expecting boolean/false got %s/%s @\n", gettype($ret), var_export($ret, true), $version);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var_dump($mysql->ping());
|
||||
var_dump($mysql->ping());
|
||||
|
||||
$mysql->close();
|
||||
$mysql->close();
|
||||
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
var_dump(mysqli_ping($mysql));
|
||||
var_dump(mysqli_ping($mysql));
|
||||
|
||||
$ret = $mysql->kill($mysql->thread_id);
|
||||
if ($IS_MYSQLND) {
|
||||
if ($ret !== true){
|
||||
printf("[002] Expecting boolean/true got %s/%s\n", gettype($ret), var_export($ret, true));
|
||||
}
|
||||
} else {
|
||||
/* libmysql return value seems to depend on server version */
|
||||
if ((($version >= 50123) || ($version <= 40200)) && $version != 50200) {
|
||||
/* TODO: find exact version */
|
||||
if ($ret !== true){
|
||||
printf("[002] Expecting boolean/true got %s/%s @\n", gettype($ret), var_export($ret, true), $version);
|
||||
}
|
||||
} else {
|
||||
if ($ret !== false){
|
||||
printf("[002] Expecting boolean/false got %s/%s @\n", gettype($ret), var_export($ret, true), $version);
|
||||
}
|
||||
}
|
||||
}
|
||||
$ret = $mysql->kill($mysql->thread_id);
|
||||
if ($IS_MYSQLND) {
|
||||
if ($ret !== true){
|
||||
printf("[002] Expecting boolean/true got %s/%s\n", gettype($ret), var_export($ret, true));
|
||||
}
|
||||
} else {
|
||||
/* libmysql return value seems to depend on server version */
|
||||
if ((($version >= 50123) || ($version <= 40200)) && $version != 50200) {
|
||||
/* TODO: find exact version */
|
||||
if ($ret !== true){
|
||||
printf("[002] Expecting boolean/true got %s/%s @\n", gettype($ret), var_export($ret, true), $version);
|
||||
}
|
||||
} else {
|
||||
if ($ret !== false){
|
||||
printf("[002] Expecting boolean/false got %s/%s @\n", gettype($ret), var_export($ret, true), $version);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var_dump(mysqli_ping($mysql));
|
||||
var_dump(mysqli_ping($mysql));
|
||||
|
||||
$mysql->close();
|
||||
print "done!";
|
||||
$mysql->close();
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
|
||||
+10
-10
@@ -7,22 +7,22 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$mysql->query("DROP TABLE IF EXISTS not_exists");
|
||||
$mysql->query("DROP TABLE IF EXISTS not_exists");
|
||||
|
||||
var_dump($mysql->warning_count);
|
||||
var_dump($mysql->warning_count);
|
||||
|
||||
$w = $mysql->get_warnings();
|
||||
$w = $mysql->get_warnings();
|
||||
|
||||
var_dump($w->errno);
|
||||
var_dump($w->message);
|
||||
var_dump($w->sqlstate);
|
||||
var_dump($w->errno);
|
||||
var_dump($w->message);
|
||||
var_dump($w->sqlstate);
|
||||
|
||||
$mysql->close();
|
||||
echo "done!"
|
||||
$mysql->close();
|
||||
echo "done!"
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(1)
|
||||
|
||||
@@ -4,15 +4,15 @@ mysqli_driver properties
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
var_dump($driver->embedded);
|
||||
var_dump($driver->client_version);
|
||||
var_dump($driver->client_info);
|
||||
var_dump($driver->driver_version);
|
||||
var_dump($driver->reconnect);
|
||||
var_dump($driver->report_mode);
|
||||
print "done!";
|
||||
var_dump($driver->embedded);
|
||||
var_dump($driver->client_version);
|
||||
var_dump($driver->client_info);
|
||||
var_dump($driver->driver_version);
|
||||
var_dump($driver->reconnect);
|
||||
var_dump($driver->report_mode);
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(%s)
|
||||
|
||||
@@ -8,17 +8,17 @@ require_once('skipifconnectfailure.inc');
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
var_dump($mysqli->autocommit(false));
|
||||
$result = $mysqli->query("SELECT @@autocommit");
|
||||
var_dump($result->fetch_row());
|
||||
var_dump($mysqli->autocommit(false));
|
||||
$result = $mysqli->query("SELECT @@autocommit");
|
||||
var_dump($result->fetch_row());
|
||||
|
||||
var_dump($mysqli->autocommit(true));
|
||||
$result = $mysqli->query("SELECT @@autocommit");
|
||||
var_dump($result->fetch_row());
|
||||
var_dump($mysqli->autocommit(true));
|
||||
$result = $mysqli->query("SELECT @@autocommit");
|
||||
var_dump($result->fetch_row());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
|
||||
@@ -7,29 +7,29 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
class my_mysql extends mysqli {
|
||||
public $p_test;
|
||||
class my_mysql extends mysqli {
|
||||
public $p_test;
|
||||
|
||||
function __construct() {
|
||||
$this->p_test[] = "foo";
|
||||
$this->p_test[] = "bar";
|
||||
}
|
||||
}
|
||||
function __construct() {
|
||||
$this->p_test[] = "foo";
|
||||
$this->p_test[] = "bar";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$mysql = new my_mysql();
|
||||
$mysql = new my_mysql();
|
||||
|
||||
var_dump($mysql->p_test);
|
||||
var_dump($mysql->errno);
|
||||
var_dump($mysql->p_test);
|
||||
var_dump($mysql->errno);
|
||||
|
||||
$mysql->connect($host, $user, $passwd, $db, $port, $socket);
|
||||
$mysql->select_db("nonexistingdb");
|
||||
$mysql->connect($host, $user, $passwd, $db, $port, $socket);
|
||||
$mysql->select_db("nonexistingdb");
|
||||
|
||||
var_dump($mysql->errno > 0);
|
||||
var_dump($mysql->errno > 0);
|
||||
|
||||
$mysql->close();
|
||||
$mysql->close();
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(2) {
|
||||
|
||||
@@ -7,45 +7,45 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
/* class 1 calls parent constructor */
|
||||
class mysql1 extends mysqli {
|
||||
function __construct() {
|
||||
global $host, $user, $passwd, $db, $port, $socket;
|
||||
parent::__construct($host, $user, $passwd, $db, $port, $socket);
|
||||
}
|
||||
}
|
||||
/* class 1 calls parent constructor */
|
||||
class mysql1 extends mysqli {
|
||||
function __construct() {
|
||||
global $host, $user, $passwd, $db, $port, $socket;
|
||||
parent::__construct($host, $user, $passwd, $db, $port, $socket);
|
||||
}
|
||||
}
|
||||
|
||||
/* class 2 has an own constructor */
|
||||
class mysql2 extends mysqli {
|
||||
/* class 2 has an own constructor */
|
||||
class mysql2 extends mysqli {
|
||||
|
||||
function __construct() {
|
||||
global $host, $user, $passwd, $db, $port, $socket;
|
||||
$this->connect($host, $user, $passwd, $db, $port, $socket);
|
||||
}
|
||||
}
|
||||
function __construct() {
|
||||
global $host, $user, $passwd, $db, $port, $socket;
|
||||
$this->connect($host, $user, $passwd, $db, $port, $socket);
|
||||
}
|
||||
}
|
||||
|
||||
/* class 3 has no constructor */
|
||||
class mysql3 extends mysqli {
|
||||
/* class 3 has no constructor */
|
||||
class mysql3 extends mysqli {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$foo[0] = new mysql1();
|
||||
$foo[1] = new mysql2();
|
||||
$foo[2] = new mysql3($host, $user, $passwd, $db, $port, $socket);
|
||||
$foo[0] = new mysql1();
|
||||
$foo[1] = new mysql2();
|
||||
$foo[2] = new mysql3($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
|
||||
for ($i=0; $i < 3; $i++) {
|
||||
if (($result = $foo[$i]->query("SELECT DATABASE()"))) {
|
||||
$row = $result->fetch_row();
|
||||
if ($row[0] != $db)
|
||||
printf("%d: %s\n", $i, $row[0]);
|
||||
$result->close();
|
||||
}
|
||||
$foo[$i]->close();
|
||||
}
|
||||
print "done!";
|
||||
for ($i=0; $i < 3; $i++) {
|
||||
if (($result = $foo[$i]->query("SELECT DATABASE()"))) {
|
||||
$row = $result->fetch_row();
|
||||
if ($row[0] != $db)
|
||||
printf("%d: %s\n", $i, $row[0]);
|
||||
$result->close();
|
||||
}
|
||||
$foo[$i]->close();
|
||||
}
|
||||
print "done!";
|
||||
?>
|
||||
--EXPECT--
|
||||
done!
|
||||
@@ -7,20 +7,20 @@ require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("connect.inc");
|
||||
require_once("connect.inc");
|
||||
|
||||
class mysql1 extends mysqli {
|
||||
}
|
||||
class mysql1 extends mysqli {
|
||||
}
|
||||
|
||||
class mysql2 extends mysql1 {
|
||||
}
|
||||
class mysql2 extends mysql1 {
|
||||
}
|
||||
|
||||
$mysql = new mysql2($host, $user, $passwd, $db, $port, $socket);
|
||||
$mysql = new mysql2($host, $user, $passwd, $db, $port, $socket);
|
||||
|
||||
$mysql->query("THIS DOES NOT WORK");
|
||||
printf("%d\n", $mysql->errno);
|
||||
$mysql->query("THIS DOES NOT WORK");
|
||||
printf("%d\n", $mysql->errno);
|
||||
|
||||
$mysql->close();
|
||||
$mysql->close();
|
||||
?>
|
||||
--EXPECT--
|
||||
1064
|
||||
@@ -6,13 +6,13 @@ Bug #31141 (properties declared in the class extending MySQLi are not available)
|
||||
<?php
|
||||
class Test extends mysqli
|
||||
{
|
||||
public $test = array();
|
||||
public $test = array();
|
||||
|
||||
function foo()
|
||||
{
|
||||
$ar_test = array("foo", "bar");
|
||||
$this->test = &$ar_test;
|
||||
}
|
||||
function foo()
|
||||
{
|
||||
$ar_test = array("foo", "bar");
|
||||
$this->test = &$ar_test;
|
||||
}
|
||||
}
|
||||
|
||||
$my_test = new Test;
|
||||
|
||||
Loaded 100 of 479 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user