Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

CVS update of libmysequoia (102 files): msg#00104

db.carob.cvs

Subject: CVS update of libmysequoia (102 files)

Date: Tuesday, March 21, 2006 @ 06:39:05
Author: csaba
Path: /cvsroot/carob/libmysequoia

Removed: proto/Makefile (1.3) proto/hello-libmysequoia.c (1.3)
proto/libmysequoia.cpp (1.4) test-suite/php4/mysql/001.phpt
(1.1) test-suite/php4/mysql/002.phpt (1.1)
test-suite/php4/mysql/003.phpt (1.1)
test-suite/php4/mysql/connect.inc (1.1)
test-suite/php4/mysql/skipif.inc (1.1)
test-suite/php4/run-tests.php (1.1) test-suite/php5/README (1.5)
test-suite/php5/mysql/001.phpt (1.1)
test-suite/php5/mysql/002.phpt (1.1)
test-suite/php5/mysql/003.phpt (1.1)
test-suite/php5/mysql/connect.inc (1.1)
test-suite/php5/mysql/skipif.inc (1.1)
test-suite/php5/mysqli/.cvsignore (1.1)
test-suite/php5/mysqli/001.phpt (1.1)
test-suite/php5/mysqli/002.phpt (1.1)
test-suite/php5/mysqli/003.phpt (1.1)
test-suite/php5/mysqli/004.phpt (1.1)
test-suite/php5/mysqli/005.phpt (1.1)
test-suite/php5/mysqli/006.phpt (1.1)
test-suite/php5/mysqli/007.phpt (1.1)
test-suite/php5/mysqli/008.phpt (1.1)
test-suite/php5/mysqli/009.phpt (1.1)
test-suite/php5/mysqli/010.phpt (1.1)
test-suite/php5/mysqli/011.phpt (1.1)
test-suite/php5/mysqli/012.phpt (1.1)
test-suite/php5/mysqli/013.phpt (1.1)
test-suite/php5/mysqli/014.phpt (1.1)
test-suite/php5/mysqli/015.phpt (1.1)
test-suite/php5/mysqli/016.phpt (1.1)
test-suite/php5/mysqli/017.phpt (1.1)
test-suite/php5/mysqli/018.phpt (1.1)
test-suite/php5/mysqli/019.phpt (1.1)
test-suite/php5/mysqli/020.phpt (1.1)
test-suite/php5/mysqli/021.phpt (1.1)
test-suite/php5/mysqli/022.phpt (1.1)
test-suite/php5/mysqli/023.phpt (1.1)
test-suite/php5/mysqli/024.phpt (1.1)
test-suite/php5/mysqli/025.phpt (1.1)
test-suite/php5/mysqli/026.phpt (1.1)
test-suite/php5/mysqli/027.phpt (1.1)
test-suite/php5/mysqli/028.phpt (1.1)
test-suite/php5/mysqli/029.phpt (1.1)
test-suite/php5/mysqli/030.phpt (1.1)
test-suite/php5/mysqli/031.phpt (1.1)
test-suite/php5/mysqli/032.phpt (1.1)
test-suite/php5/mysqli/033.phpt (1.1)
test-suite/php5/mysqli/034.phpt (1.1)
test-suite/php5/mysqli/035.phpt (1.1)
test-suite/php5/mysqli/036.phpt (1.1)
test-suite/php5/mysqli/037.phpt (1.1)
test-suite/php5/mysqli/038.phpt (1.1)
test-suite/php5/mysqli/039.phpt (1.1)
test-suite/php5/mysqli/040.phpt (1.1)
test-suite/php5/mysqli/041.phpt (1.1)
test-suite/php5/mysqli/042.phpt (1.1)
test-suite/php5/mysqli/043.phpt (1.1)
test-suite/php5/mysqli/044.phpt (1.1)
test-suite/php5/mysqli/045.phpt (1.1)
test-suite/php5/mysqli/046.phpt (1.1)
test-suite/php5/mysqli/047.phpt (1.1)
test-suite/php5/mysqli/048.phpt (1.1)
test-suite/php5/mysqli/049.phpt (1.1)
test-suite/php5/mysqli/050.phpt (1.1)
test-suite/php5/mysqli/051.phpt (1.1)
test-suite/php5/mysqli/052.phpt (1.1)
test-suite/php5/mysqli/053.phpt (1.1)
test-suite/php5/mysqli/054.phpt (1.1)
test-suite/php5/mysqli/055.phpt (1.1)
test-suite/php5/mysqli/056.phpt (1.1)
test-suite/php5/mysqli/057.phpt (1.1)
test-suite/php5/mysqli/058.phpt (1.1)
test-suite/php5/mysqli/059.phpt (1.1)
test-suite/php5/mysqli/060.phpt (1.1)
test-suite/php5/mysqli/061.phpt (1.1)
test-suite/php5/mysqli/062.phpt (1.1)
test-suite/php5/mysqli/063.phpt (1.1)
test-suite/php5/mysqli/064.phpt (1.1)
test-suite/php5/mysqli/065.phpt (1.1)
test-suite/php5/mysqli/066.phpt (1.1)
test-suite/php5/mysqli/067.phpt (1.1)
test-suite/php5/mysqli/bug28817.phpt (1.1)
test-suite/php5/mysqli/bug29311.phpt (1.1)
test-suite/php5/mysqli/bug30967.phpt (1.1)
test-suite/php5/mysqli/bug31141.phpt (1.1)
test-suite/php5/mysqli/bug31668.phpt (1.1)
test-suite/php5/mysqli/bug32405.phpt (1.1)
test-suite/php5/mysqli/bug33090.phpt (1.1)
test-suite/php5/mysqli/bug33263.phpt (1.1)
test-suite/php5/mysqli/bug33491.phpt (1.1)
test-suite/php5/mysqli/bug34785.phpt (1.1)
test-suite/php5/mysqli/bug34810.phpt (1.1)
test-suite/php5/mysqli/bug35103.phpt (1.1)
test-suite/php5/mysqli/bug35517.phpt (1.1)
test-suite/php5/mysqli/bug35759.phpt (1.1)
test-suite/php5/mysqli/connect.inc (1.2)
test-suite/php5/mysqli/skipif.inc (1.2)
test-suite/php5/mysqli/skipifemb.inc (1.2) test-suite/php5/run
(1.1) test-suite/php5/run-tests.php (1.1)

Removed the php test-suite. You can find it at http://php.net no need to
duplicate here.
Removed also the proto directory.


--------------------------------------+
proto/Makefile | 37
proto/hello-libmysequoia.c | 151 --
proto/libmysequoia.cpp | 448 --------
test-suite/php4/mysql/001.phpt | 30
test-suite/php4/mysql/002.phpt | 53
test-suite/php4/mysql/003.phpt | 56 -
test-suite/php4/mysql/connect.inc | 10
test-suite/php4/mysql/skipif.inc | 8
test-suite/php4/run-tests.php | 888 ----------------
test-suite/php5/README | 222 ----
test-suite/php5/mysql/001.phpt | 30
test-suite/php5/mysql/002.phpt | 53
test-suite/php5/mysql/003.phpt | 84 -
test-suite/php5/mysql/connect.inc | 10
test-suite/php5/mysql/skipif.inc | 8
test-suite/php5/mysqli/.cvsignore | 4
test-suite/php5/mysqli/001.phpt | 47
test-suite/php5/mysqli/002.phpt | 62 -
test-suite/php5/mysqli/003.phpt | 58 -
test-suite/php5/mysqli/004.phpt | 60 -
test-suite/php5/mysqli/005.phpt | 40
test-suite/php5/mysqli/006.phpt | 54
test-suite/php5/mysqli/007.phpt | 54
test-suite/php5/mysqli/008.phpt | 54
test-suite/php5/mysqli/009.phpt | 79 -
test-suite/php5/mysqli/010.phpt | 59 -
test-suite/php5/mysqli/011.phpt | 57 -
test-suite/php5/mysqli/012.phpt | 58 -
test-suite/php5/mysqli/013.phpt | 52
test-suite/php5/mysqli/014.phpt | 70 -
test-suite/php5/mysqli/015.phpt | 70 -
test-suite/php5/mysqli/016.phpt | 27
test-suite/php5/mysqli/017.phpt | 37
test-suite/php5/mysqli/018.phpt | 27
test-suite/php5/mysqli/019.phpt | 70 -
test-suite/php5/mysqli/020.phpt | 67 -
test-suite/php5/mysqli/021.phpt | 42
test-suite/php5/mysqli/022.phpt | 46
test-suite/php5/mysqli/023.phpt | 65 -
test-suite/php5/mysqli/024.phpt | 66 -
test-suite/php5/mysqli/025.phpt | 70 -
test-suite/php5/mysqli/026.phpt | 49
test-suite/php5/mysqli/027.phpt | 20
test-suite/php5/mysqli/028.phpt | 19
test-suite/php5/mysqli/029.phpt | 25
test-suite/php5/mysqli/030.phpt | 25
test-suite/php5/mysqli/031.phpt | 25
test-suite/php5/mysqli/032.phpt | 25
test-suite/php5/mysqli/033.phpt | 20
test-suite/php5/mysqli/034.phpt | 20
test-suite/php5/mysqli/035.phpt | 19
test-suite/php5/mysqli/036.phpt | 51
test-suite/php5/mysqli/037.phpt | 36
test-suite/php5/mysqli/038.phpt | 33
test-suite/php5/mysqli/039.phpt | 26
test-suite/php5/mysqli/040.phpt | 33
test-suite/php5/mysqli/041.phpt | 22
test-suite/php5/mysqli/042.phpt | 62 -
test-suite/php5/mysqli/043.phpt | 42
test-suite/php5/mysqli/044.phpt | 21
test-suite/php5/mysqli/045.phpt | 46
test-suite/php5/mysqli/046.phpt | 33
test-suite/php5/mysqli/047.phpt | 83 -
test-suite/php5/mysqli/048.phpt | 62 -
test-suite/php5/mysqli/049.phpt | 24
test-suite/php5/mysqli/050.phpt | 21
test-suite/php5/mysqli/051.phpt | 22
test-suite/php5/mysqli/052.phpt | 22
test-suite/php5/mysqli/053.phpt | 20
test-suite/php5/mysqli/054.phpt | 20
test-suite/php5/mysqli/055.phpt | 19
test-suite/php5/mysqli/056.phpt | 21
test-suite/php5/mysqli/057.phpt | 54
test-suite/php5/mysqli/058.phpt | 57 -
test-suite/php5/mysqli/059.phpt | 41
test-suite/php5/mysqli/060.phpt | 60 -
test-suite/php5/mysqli/061.phpt | 44
test-suite/php5/mysqli/062.phpt | 25
test-suite/php5/mysqli/063.phpt | 21
test-suite/php5/mysqli/064.phpt | 21
test-suite/php5/mysqli/065.phpt | 41
test-suite/php5/mysqli/066.phpt | 28
test-suite/php5/mysqli/067.phpt | 51
test-suite/php5/mysqli/bug28817.phpt | 39
test-suite/php5/mysqli/bug29311.phpt | 48
test-suite/php5/mysqli/bug30967.phpt | 23
test-suite/php5/mysqli/bug31141.phpt | 28
test-suite/php5/mysqli/bug31668.phpt | 56 -
test-suite/php5/mysqli/bug32405.phpt | 39
test-suite/php5/mysqli/bug33090.phpt | 21
test-suite/php5/mysqli/bug33263.phpt | 31
test-suite/php5/mysqli/bug33491.phpt | 26
test-suite/php5/mysqli/bug34785.phpt | 47
test-suite/php5/mysqli/bug34810.phpt | 38
test-suite/php5/mysqli/bug35103.phpt | 68 -
test-suite/php5/mysqli/bug35517.phpt | 29
test-suite/php5/mysqli/bug35759.phpt | 44
test-suite/php5/mysqli/connect.inc | 9
test-suite/php5/mysqli/skipif.inc | 12
test-suite/php5/mysqli/skipifemb.inc | 2
test-suite/php5/run | 3
test-suite/php5/run-tests.php | 1801 ---------------------------------
102 files changed, 7256 deletions(-)


Index: libmysequoia/proto/Makefile
diff -u libmysequoia/proto/Makefile:1.3 libmysequoia/proto/Makefile:removed
--- libmysequoia/proto/Makefile:1.3 Mon Jan 2 13:19:56 2006
+++ libmysequoia/proto/Makefile Tue Mar 21 06:39:05 2006
@@ -1,37 +0,0 @@
-# Sequoia: Database clustering technology.
-# Copyright (C) 2005-2006 Continuent, Inc.
-# Contact: sequoia-NAAfj4rwCWAYtQj7fl1lsA@xxxxxxxxxxxxxxxx
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Initial developer(s): Zsolt Simon, Csaba Simon
-# Contributor(s):
-#
-
-all: hello-libmysequoia libmysqlclient.so.15.1
-
-hello-libmysequoia: hello-libmysequoia.c
- cc -Wall -g `mysql_config --include` -o $@ $< `mysql_config --libs`
-
-libmysqlclient.so.15.1: libmysql.o
- c++ -Wall -g -fPIC --shared -L../../carob -lcarobcpp -o $@ $<
- ln -sf $@ libmysqlclient.so.15
-
-libmysql.o: libmysequoia.cpp
- c++ -Wall -g -o $@ -I../../carob/include -I/usr/include/mysql -c $<
-
-clean:
- rm -f libmysqlclient.so.15.1 libmysqlclient.so.15 libmysql.o
hello-libmysequoia
-
-run: all
- LD_LIBRARY_PATH=.:../../carob ./hello-libmysequoia
Index: libmysequoia/proto/hello-libmysequoia.c
diff -u libmysequoia/proto/hello-libmysequoia.c:1.3
libmysequoia/proto/hello-libmysequoia.c:removed
--- libmysequoia/proto/hello-libmysequoia.c:1.3 Mon Jan 2 13:19:56 2006
+++ libmysequoia/proto/hello-libmysequoia.c Tue Mar 21 06:39:05 2006
@@ -1,151 +0,0 @@
-/*
- * Sequoia: Database clustering technology.
- * Copyright (C) 2005-2006 Continuent, Inc.
- * Contact: sequoia-NAAfj4rwCWAYtQj7fl1lsA@xxxxxxxxxxxxxxxx
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Initial developer(s): Zsolt Simon, Csaba Simon
- * Contributor(s):
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <my_global.h>
-#include <my_sys.h>
-#include <mysql.h>
-
-/*
- * To create the table and insert some data:
- * $ mysql -uroot -prootpass
- * > USE test;
- * > CREATE table t1 ( `a` int(11) NOT NULL auto_increment,
- * `b` int(11) default NULL,
- * PRIMARY KEY (`a`)
- * ) ENGINE=InnoDB;
- * > INSERT INTO t1 (b) VALUES (1),(2),(3)
- * > exit
- */
-
-static void
-print_error (MYSQL * conn, char *message)
-{
- fprintf (stderr, "%s\n", message);
- if (conn != NULL)
- {
- fprintf (stderr, "Error %u (%s): %s\n",
- mysql_errno (conn), mysql_sqlstate (conn), mysql_error (conn));
- }
-}
-
-
-void
-process_result_set (MYSQL * conn, MYSQL_RES * res_set)
-{
- MYSQL_ROW row;
- unsigned int i;
-
- while ((row = mysql_fetch_row (res_set)) != NULL)
- {
- for (i = 0; i < mysql_num_fields (res_set); i++)
- {
- if (i > 0)
- {
- fputc ('\t', stdout);
- }
- printf ("%s", row[i] != NULL ? row[i] : "NULL");
- }
- fputc ('\n', stdout);
- }
- if (mysql_errno (conn) != 0)
- print_error (conn, "mysql_fetch_row() failed");
- else
- printf ("%lu rows returned\n", (unsigned long) mysql_num_rows (res_set));
-}
-
-
-int
-main ()
-{
- char *opt_host_name = "localhost"; /* server host (default=localhost) */
- char *opt_user_name = "user"; /* username (default=login name) */
- char *opt_password = "userpass"; /* password (default=none) */
- unsigned int opt_port_num = 0; /* port number (use built-in value) */
- char *opt_socket_name = NULL; /* socket name (use built-in value) */
- char *opt_db_name = "db"; /* database name (default=none) */
- unsigned int opt_flags = 0; /* connection flags (none) */
- MYSQL *conn; /* pointer to connection handler */
- MYSQL_RES *res_set;
-
- /* initialize connection handler */
- conn = mysql_init (NULL);
- if (conn == NULL)
- {
- fprintf (stderr, "mysql_init() failed (probably out of memory)\n");
- exit (1);
- }
-
- /* connect to server */
- if (mysql_real_connect (conn, opt_host_name, opt_user_name, opt_password,
- opt_db_name, opt_port_num, opt_socket_name,
- opt_flags) == NULL)
- {
- fprintf (stderr, "mysql_real_connect() failed\n");
- mysql_close (conn);
- exit (1);
- }
-
- /* the insert must succed */
- if (mysql_query (conn, "INSERT INTO t1(b) VALUES (4)") != 0)
- {
- print_error (conn, "INSERT statement failed");
- }
- else
- {
- printf ("INSERT statement succeeded: %lu rows affected\n",
- (unsigned long) mysql_affected_rows (conn));
- }
-
- /* the insert must fail (duplicate key) */
-/* if (mysql_query (conn, "INSERT INTO t1 (a,b) VALUES (1,2)") != 0)
- {
- print_error (conn, "INSERT statement failed");
- }
- else
- {
- printf ("INSERT statement succeeded: %lu rows affected\n",
- (unsigned long) mysql_affected_rows (conn));
- }*/
-
- /* simple query */
- if (mysql_query (conn, "SELECT * from t1") != 0)
- print_error (conn, "mysql_query() failed");
- else
- {
- res_set = mysql_store_result (conn); /* generate result set */
- if (res_set == NULL)
- print_error (conn, "mysql_store_result() failed");
- else
- {
- /* process result set, and then deallocate it */
- process_result_set (conn, res_set);
-// mysql_free_result (res_set);
- }
- }
-
- /* disconnect from server */
- mysql_close (conn);
-
- return 0;
-}
Index: libmysequoia/proto/libmysequoia.cpp
diff -u libmysequoia/proto/libmysequoia.cpp:1.4
libmysequoia/proto/libmysequoia.cpp:removed
--- libmysequoia/proto/libmysequoia.cpp:1.4 Mon Jan 2 13:19:56 2006
+++ libmysequoia/proto/libmysequoia.cpp Tue Mar 21 06:39:05 2006
@@ -1,448 +0,0 @@
-/*
- * Sequoia: Database clustering technology.
- * Copyright (C) 2005-2006 Continuent, Inc.
- * Contact: sequoia-NAAfj4rwCWAYtQj7fl1lsA@xxxxxxxxxxxxxxxx
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Initial developer(s): Zsolt Simon, Csaba Simon
- * Contributor(s):
- */
-
- /**
- * This is only a first prototype that is demonstrating that
- * the libmysequoia project is doable.
- * There is no error checking nor exception handling and no
- * comment on the code.
- */
-
-/* C includes */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* MySQL includes */
-#include <my_global.h>
-#include <my_sys.h>
-#include <mysql.h>
-#include <errmsg.h>
-
-/* Carob includes */
-#include <ConnectionParameters.hpp>
-#include <Connection.hpp>
-#include <DriverResultSet.hpp>
-#include <Statement.hpp>
-
-/* C++ includes */
-#include <string>
-#include <vector>
-#include <locale>
-
-using namespace CarobNS;
-
-void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate);
-
-const char *client_errors[]=
-{
- "Unknown MySQL error",
- "Can't create UNIX socket (%d)",
- "Can't connect to local MySQL server through socket '%-.100s' (%d)",
- "Can't connect to MySQL server on '%-.100s' (%d)",
- "Can't create TCP/IP socket (%d)",
- "Unknown MySQL server host '%-.100s' (%d)",
- "MySQL server has gone away",
- "Protocol mismatch; server version = %d, client version = %d",
- "MySQL client ran out of memory",
- "Wrong host info",
- "Localhost via UNIX socket",
- "%-.100s via TCP/IP",
- "Error in server handshake",
- "Lost connection to MySQL server during query",
- "Commands out of sync; you can't run this command now",
- "Named pipe: %-.32s",
- "Can't wait for named pipe to host: %-.64s pipe: %-.32s (%lu)",
- "Can't open named pipe to host: %-.64s pipe: %-.32s (%lu)",
- "Can't set state of named pipe to host: %-.64s pipe: %-.32s (%lu)",
- "Can't initialize character set %-.32s (path: %-.100s)",
- "Got packet bigger than 'max_allowed_packet' bytes",
- "Embedded server",
- "Error on SHOW SLAVE STATUS:",
- "Error on SHOW SLAVE HOSTS:",
- "Error connecting to slave:",
- "Error connecting to master:",
- "SSL connection error",
- "Malformed packet",
- "This client library is licensed only for use with MySQL servers having '%s'
license",
- "Invalid use of null pointer",
- "Statement not prepared",
- "No data supplied for parameters in prepared statement",
- "Data truncated",
- "No parameters exist in the statement",
- "Invalid parameter number",
- "Can't send long data for non-string/non-binary data types (parameter: %d)",
- "Using unsupported buffer type: %d (parameter: %d)",
- "Shared memory: %-.100s",
- "Can't open shared memory; client could not create request event (%lu)",
- "Can't open shared memory; no answer event received from server (%lu)",
- "Can't open shared memory; server could not allocate file mapping (%lu)",
- "Can't open shared memory; server could not get pointer to file mapping
(%lu)",
- "Can't open shared memory; client could not allocate file mapping (%lu)",
- "Can't open shared memory; client could not get pointer to file mapping
(%lu)",
- "Can't open shared memory; client could not create %s event (%lu)",
- "Can't open shared memory; no answer from server (%lu)",
- "Can't open shared memory; cannot send request event to server (%lu)",
- "Wrong or unknown protocol",
- "Invalid connection handle",
- "Connection using old (pre-4.1.1) authentication protocol refused (client
option 'secure_auth' enabled)",
- "Row retrieval was canceled by mysql_stmt_close() call",
- "Attempt to read column without prior row fetch",
- "Prepared statement contains no metadata",
- "Attempt to read a row while there is no result set associated with the
statement",
- "This feature is not implemented yet",
- ""
-};
-
-const char *unknown_sqlstate= "HY000";
-const char *not_error_sqlstate= "00000";
-
-class CarobMYSQL;
-
-typedef struct st_cmysql {
- MYSQL my;
- CarobMYSQL *carob;
-} CMYSQL;
-
-class CarobMYSQL
-{
-public:
- CarobMYSQL();
- ~CarobMYSQL();
-
- bool connect(const char *host, const char *user,
- const char *passwd, const char *db, unsigned int port,
- const char *unix_socket, unsigned long clientflag);
- bool real_query(const char *query, ulong length);
- MYSQL_RES *get_results(int size);
- MYSQL_ROW fetch_row();
-
- MYSQL *getMYSQL();
-
-private:
- CMYSQL *mysqlPtr;
- Connection *connectionPtr;
- Statement *stmtPtr;
- DriverResultSet* drsPtr;
- MYSQL_ROW row;
- int nfields;
-
- void allocRow(int no);
- void deleteRow();
-};
-
-CarobMYSQL::CarobMYSQL() : connectionPtr(NULL), stmtPtr(NULL), drsPtr(NULL)
-{
- mysqlPtr = new CMYSQL();
- memset(&mysqlPtr->my, 0, sizeof(MYSQL));
- mysqlPtr->carob = this;
-}
-
-CarobMYSQL::~CarobMYSQL()
-{
- delete mysqlPtr;
- if (connectionPtr) delete connectionPtr;
- if (stmtPtr) delete stmtPtr;
-// if (drsPtr) delete drsPtr;
- deleteRow();
-}
-
-bool CarobMYSQL::connect(const char *host, const char *user,
- const char *passwd, const char *db, unsigned int port,
- const char *unix_socket, unsigned long clientflag)
-{
- if (unix_socket)
- {
- set_mysql_error((MYSQL *)mysqlPtr, CR_NOT_IMPLEMENTED,
unknown_sqlstate);
- return false;
- }
-
-//TODO Fill the mysqlPtr structure
- ConnectionParameters connectionParameters(fromString(host), port ? port
: 25322, fromString(db), fromString(user), fromString(passwd),
DEBUG_LEVEL_DEBUG);
-
- try {
- connectionPtr = new Connection(connectionParameters);
- stmtPtr = connectionPtr->createStatement();
- } catch (...) {
- set_mysql_error((MYSQL *)mysqlPtr, CR_CONNECTION_ERROR,
unknown_sqlstate);
- return false;
- }
-
- return true;
-}
-
-bool CarobMYSQL::real_query(const char *query, ulong length)
-{
- try {
- if (drsPtr) delete drsPtr;
-
- if (stmtPtr->execute(fromString(query)))
- mysqlPtr->my.affected_rows = 0;
- else
- mysqlPtr->my.affected_rows = stmtPtr->getUpdateCount();
-
- return true;
- } catch (...) {
- //TODO Error : connectionPtr(NULL), stmtPtr(NULL),
drsPtr(NULL)handling
- return false;
- }
-}
-
-MYSQL_RES * CarobMYSQL::get_results(int size)
-{
- try {
- if (stmtPtr)
- {
- stmtPtr->setFetchSize(size);
- drsPtr = stmtPtr->getResultSet();
- if (drsPtr)
- {
- mysqlPtr->my.field_count =
drsPtr->getNumberOfColumns();
- mysqlPtr->my.affected_rows =
drsPtr->getNumberOfRowsInMemory();
- }
- return (MYSQL_RES *) this;
- }
- return NULL;
- } catch (...) {
- //TODO error handling
- return NULL;
- }
-}
-
-MYSQL_ROW CarobMYSQL::fetch_row()
-{
- if (drsPtr)
- {
- deleteRow();
- if (drsPtr->next())
- {
- allocRow(mysqlPtr->my.field_count);
- for (unsigned i=0; i<mysqlPtr->my.field_count; i++)
- {
- char s[200];
- sprintf(s,"%d",drsPtr->getAsInt(i+1));
- row[i] = new char[strlen(s)+1];
- strcpy(row[i],s);
- }
-
- mysqlPtr->my.affected_rows =
drsPtr->getNumberOfRowsInMemory();
-
- return row;
- }
- return 0;
- }
- else
- return 0;
-}
-
-MYSQL *CarobMYSQL::getMYSQL()
-{
- return (MYSQL *) mysqlPtr;
-}
-
-typedef char *PCHAR;
-
-void CarobMYSQL::allocRow(int no)
-{
- row = new PCHAR[no];
- nfields = no;
- memset(row, sizeof(PCHAR)*no, 0);
-}
-
-void CarobMYSQL::deleteRow()
-{
- if (row)
- {
- for (int i=0; i<nfields; i++)
- if (row[i]) delete row[i];
- delete row;
- row = NULL;
- }
-}
-
-/***********************************
- * MySQL functions
- ***********************************/
-
-MYSQL *STDCALL
-mysql_init(MYSQL * mysql)
-{
- if (!mysql)
- {
- CarobMYSQL *tmp = new CarobMYSQL();
- mysql = tmp->getMYSQL();
- }
-
- return mysql;
-}
-
-MYSQL *STDCALL
-mysql_real_connect (MYSQL * mysql, const char *host, const char *user,
- const char *passwd, const char *db, unsigned int port,
- const char *unix_socket, unsigned long clientflag)
-{
- if (mysql) {
- return ((CMYSQL *)mysql)->carob->connect(host, user, passwd,
db, port, unix_socket, clientflag) ? mysql : 0;
- }
- else
- {
- set_mysql_error(mysql, CR_NULL_POINTER, unknown_sqlstate);
- return 0;
- }
-}
-
-void STDCALL
-mysql_close (MYSQL *sock)
-{
- if (sock)
- delete ((CMYSQL *)sock)->carob;
-}
-
-/* error handling functions */
-void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate)
-{
- NET *net;
-
- net= &mysql->net;
- net->last_errno= errcode;
- strcpy(net->last_error, ER(errcode));
- strcpy(net->sqlstate, sqlstate);
-}
-
-unsigned int STDCALL
-mysql_errno(MYSQL *mysql)
-{
- return mysql->net.last_errno;
-}
-
-const char * STDCALL
-mysql_error(MYSQL *mysql)
-{
- return mysql->net.last_error;
-}
-
-const char *STDCALL
-mysql_sqlstate(MYSQL *mysql)
-{
- return mysql->net.sqlstate;
-}
-
-int STDCALL
-mysql_query(MYSQL *mysql, const char *q)
-{
- return mysql_real_query(mysql, q, 0);
-}
-
-int STDCALL
-mysql_real_query(MYSQL *mysql, const char *query, ulong length)
-{
- if (mysql) {
- //FIXME handle special strings which can contains '\0'
- if ( ((CMYSQL *)mysql)->carob->real_query(query, length) )
- {
- return 0;
- }
- else
- {
- set_mysql_error(mysql, CR_UNKNOWN_ERROR,
unknown_sqlstate);
- return CR_UNKNOWN_ERROR;
- }
- }
- else
- {
- set_mysql_error(mysql, CR_UNKNOWN_ERROR, unknown_sqlstate);
- return CR_UNKNOWN_ERROR;
- }
-}
-
-MYSQL_RES * STDCALL
-mysql_store_result(MYSQL *mysql)
-{
- if (mysql) {
- return ((CMYSQL *)mysql)->carob->get_results(0);
- }
- else
- {
- set_mysql_error(mysql, CR_NULL_POINTER, unknown_sqlstate);
- return 0;
- }
-}
-
-MYSQL_RES * STDCALL
-mysql_use_result(MYSQL *mysql)
-{
- if (mysql) {
- return ((CMYSQL *)mysql)->carob->get_results(1);
- }
- else
- {
- set_mysql_error(mysql, CR_NULL_POINTER, unknown_sqlstate);
- return 0;
- }
-}
-
-MYSQL_ROW STDCALL mysql_fetch_row(MYSQL_RES *result)
-{
- if (result) {
- return ((CarobMYSQL *)result)->fetch_row();
- }
- else
- {
- //TODO set error
- return 0;
- }
-}
-
-unsigned int STDCALL mysql_num_fields(MYSQL_RES *res)
-{
- if (res) {
- return ((CarobMYSQL *)res)->getMYSQL()->field_count; //
get_num_fields();
- }
- else
- {
- //TODO set error
- return 0;
- }
-}
-
-my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql)
-{
- if (mysql) {
- return mysql->affected_rows;
- }
- else
- {
- //TODO set error
- return 0;
- }
-}
-
-my_ulonglong STDCALL mysql_num_rows(MYSQL_RES *res)
-{
- if (res) {
- return ((CarobMYSQL *)res)->getMYSQL()->affected_rows;
- }
- else
- {
- //TODO set error
- return 0;
- }
-}
Index: libmysequoia/test-suite/php4/mysql/001.phpt
diff -u libmysequoia/test-suite/php4/mysql/001.phpt:1.1
libmysequoia/test-suite/php4/mysql/001.phpt:removed
--- libmysequoia/test-suite/php4/mysql/001.phpt:1.1 Wed Feb 1 12:43:04 2006
+++ libmysequoia/test-suite/php4/mysql/001.phpt Tue Mar 21 06:39:05 2006
@@ -1,30 +0,0 @@
---TEST--
-mysql connect
---SKIPIF--
-<?php include 'skipif.inc'; ?>
---FILE--
-<?php
-
-include 'connect.inc';
-$test = '';
-
-/*** test mysql_connect 127.0.0.1 ***/
-$db = mysql_connect('127.0.0.1', $user, $passwd);
-$test .= ($db) ? '1' : '0';
-mysql_close($db);
-
-/*** test mysql_connect localhost ***/
-$db = mysql_connect($host, $user, $passwd);
-$test .= ($db) ? '1' : '0';
-mysql_close($db);
-
-/*** test mysql_connect localhost:port ***/
-$db = mysql_connect("{$host}:3306", $user, $passwd, '');
-$test .= ($db) ? '1' : '0';
-mysql_close($db);
-
-var_dump($test);
-
-?>
---EXPECT--
-string(3) "111"
Index: libmysequoia/test-suite/php4/mysql/002.phpt
diff -u libmysequoia/test-suite/php4/mysql/002.phpt:1.1
libmysequoia/test-suite/php4/mysql/002.phpt:removed
--- libmysequoia/test-suite/php4/mysql/002.phpt:1.1 Wed Feb 1 12:43:04 2006
+++ libmysequoia/test-suite/php4/mysql/002.phpt Tue Mar 21 06:39:05 2006
@@ -1,53 +0,0 @@
---TEST--
-mysql_fetch_array
---SKIPIF--
-<?php include 'skipif.inc'; ?>
---FILE--
-<?php
-
-include 'connect.inc';
-
-$db = mysql_connect($host, $user, $passwd);
-
-var_dump($db);
-
-var_dump(mysql_select_db('test'));
-
-var_dump(mysql_query('DROP TABLE IF EXISTS test'));
-
-var_dump(mysql_query('CREATE TABLE test(col1 int PRIMARY KEY, col2
varchar(50), col3 char(5))'));
-
-var_dump(mysql_query("INSERT INTO test(col1, col2, col3) VALUES(1, 'foo',
'bar'),(2, 'foo', 'bar')"));
-
-var_dump($res = mysql_query('SELECT col1, col2, col3 FROM test ORDER BY col1
ASC'));
-
-while ($data = mysql_fetch_array($res, MYSQL_ASSOC)) {
- var_dump($data);
-}
-
-mysql_close($db);
-
-?>
---EXPECTF--
-resource(%d) of type (mysql link)
-bool(true)
-bool(true)
-bool(true)
-bool(true)
-resource(%d) of type (mysql result)
-array(3) {
- ["col1"]=>
- string(1) "1"
- ["col2"]=>
- string(3) "foo"
- ["col3"]=>
- string(3) "bar"
-}
-array(3) {
- ["col1"]=>
- string(1) "2"
- ["col2"]=>
- string(3) "foo"
- ["col3"]=>
- string(3) "bar"
-}
Index: libmysequoia/test-suite/php4/mysql/003.phpt
diff -u libmysequoia/test-suite/php4/mysql/003.phpt:1.1
libmysequoia/test-suite/php4/mysql/003.phpt:removed
--- libmysequoia/test-suite/php4/mysql/003.phpt:1.1 Wed Feb 1 12:43:04 2006
+++ libmysequoia/test-suite/php4/mysql/003.phpt Tue Mar 21 06:39:05 2006
@@ -1,56 +0,0 @@
---TEST--
-mysql_fetch_object
---SKIPIF--
-<?php include 'skipif.inc'; ?>
---FILE--
-<?php
-
-include 'connect.inc';
-
-$data = array(
- "one",
- "two",
- "three"
- );
-
-$db = mysql_connect($host, $user, $passwd);
-
-mysql_select_db("test");
-
-mysql_query('DROP TABLE IF EXISTS test');
-
-mysql_query("CREATE TABLE test(a varchar(10))");
-
-foreach ($data as $str) {
- mysql_query("INSERT INTO test VALUES('$str')");
- var_dump($str);
-}
-
-echo "==stdClass==\n";
-$res = mysql_query("SELECT a FROM test");
-while ($obj = mysql_fetch_object($res)) {
- var_dump($obj);
-}
-
-mysql_close($db);
-
-?>
-==DONE==
---EXPECTF--
-string(3) "one"
-string(3) "two"
-string(5) "three"
-==stdClass==
-object(stdClass)(1) {
- ["a"]=>
- string(3) "one"
-}
-object(stdClass)(1) {
- ["a"]=>
- string(3) "two"
-}
-object(stdClass)(1) {
- ["a"]=>
- string(5) "three"
-}
-==DONE==
Index: libmysequoia/test-suite/php4/mysql/connect.inc
diff -u libmysequoia/test-suite/php4/mysql/connect.inc:1.1
libmysequoia/test-suite/php4/mysql/connect.inc:removed
--- libmysequoia/test-suite/php4/mysql/connect.inc:1.1 Wed Feb 1 12:43:04 2006
+++ libmysequoia/test-suite/php4/mysql/connect.inc Tue Mar 21 06:39:05 2006
@@ -1,10 +0,0 @@
-<?php
-
- /* default values are localhost, root and empty password
- Change the values if you use another configuration */
-
- $host = "localhost";
- $user = "root";
- $passwd = "rootpass";
-
-?>
Index: libmysequoia/test-suite/php4/mysql/skipif.inc
diff -u libmysequoia/test-suite/php4/mysql/skipif.inc:1.1
libmysequoia/test-suite/php4/mysql/skipif.inc:removed
--- libmysequoia/test-suite/php4/mysql/skipif.inc:1.1 Wed Feb 1 12:43:04 2006
+++ libmysequoia/test-suite/php4/mysql/skipif.inc Tue Mar 21 06:39:05 2006
@@ -1,8 +0,0 @@
-<?php
-
-include 'connect.inc';
-$link = @mysql_connect($host, $user, $passwd);
-if (!$link) die('skip cannot connect');
-mysql_close($link);
-
-?>
\ No newline at end of file
Index: libmysequoia/test-suite/php4/run-tests.php
diff -u libmysequoia/test-suite/php4/run-tests.php:1.1
libmysequoia/test-suite/php4/run-tests.php:removed
--- libmysequoia/test-suite/php4/run-tests.php:1.1 Wed Feb 1 12:43:04 2006
+++ libmysequoia/test-suite/php4/run-tests.php Tue Mar 21 06:39:05 2006
@@ -1,888 +0,0 @@
-<?php
-/*
- +----------------------------------------------------------------------+
- | PHP Version 4 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2002 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 2.02 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available at through the world-wide-web at |
- | http://www.php.net/license/2_02.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license-GOAhiB59KME@xxxxxxxxxxxxxxxx so we can mail you a copy
immediately. |
- +----------------------------------------------------------------------+
- | Authors: Ilia Alshanetsky <iliaa-GOAhiB59KME@xxxxxxxxxxxxxxxx>
|
- | Preston L. Bannister <pbannister-GOAhiB59KME@xxxxxxxxxxxxxxxx>
|
- | Marcus Boerger <helly-GOAhiB59KME@xxxxxxxxxxxxxxxx>
|
- | Derick Rethans <derick-GOAhiB59KME@xxxxxxxxxxxxxxxx>
|
- | Sander Roobol <sander-GOAhiB59KME@xxxxxxxxxxxxxxxx>
|
- | (based on version by: Stig Bakken <ssb-8gWjf/rZqUg@xxxxxxxxxxxxxxxx>)
|
- | (based on the PHP 3 test framework by Rasmus Lerdorf) |
- +----------------------------------------------------------------------+
- */
-
-/*
- Require exact specification of PHP executable to test (no guessing!).
- Die if any internal errors encountered in test script.
- Regularized output for simpler post-processing of output.
- Optionally output error lines indicating the failing test source and log
- for direct jump with MSVC or Emacs.
-*/
-
-/*
- * TODO:
- * - do not test PEAR components if base class and/or component class cannot
be instanciated
- */
-
-
-/* Sanity check to ensure that pcre extension needed by this script is
avaliable.
- * In the event it is not, print a nice error message indicating that this
script will
- * not run without it.
- */
-
-if (!extension_loaded("pcre")) {
- echo <<<NO_PCRE_ERROR
-
-+-----------------------------------------------------------+
-| ! ERROR ! |
-| The test-suite requires that you have pcre extension |
-| enabled. To enable this extension either compile your PHP |
-| with --with-pcre-regex or if you've compiled pcre as a |
-| shared module load it via php.ini. |
-+-----------------------------------------------------------+
-
-NO_PCRE_ERROR;
-exit;
-}
-
-// change into the PHP source directory.
-
-if (getenv('TEST_PHP_SRCDIR')) {
- @chdir(getenv('TEST_PHP_SRCDIR'));
-}
-
-$cwd = getcwd();
-set_time_limit(0);
-
-// delete as much output buffers as possible
-while(@ob_end_clean());
-if (ob_get_level()) echo "Not all buffers were deleted.\n";
-
-error_reporting(E_ALL);
-ini_set('magic_quotes_runtime',0); // this would break tests by modifying
EXPECT sections
-
-if (ini_get('safe_mode')) {
- echo <<< SAFE_MODE_WARNING
-
-+-----------------------------------------------------------+
-| ! WARNING ! |
-| You are running the test-suite with "safe_mode" ENABLED ! |
-| |
-| Chances are high that no test will work at all, |
-| depending on how you configured "safe_mode" ! |
-+-----------------------------------------------------------+
-
-
-SAFE_MODE_WARNING;
-}
-
-// Don't ever guess at the PHP executable location.
-// Require the explicit specification.
-// Otherwise we could end up testing the wrong file!
-
-if (getenv('TEST_PHP_EXECUTABLE')) {
- $php = getenv('TEST_PHP_EXECUTABLE');
- if ($php=='auto') {
- $php = $cwd.'/sapi/cli/php';
- putenv("TEST_PHP_EXECUTABLE=$php");
- }
-}
-if (empty($php) || !file_exists($php)) {
- error("environment variable TEST_PHP_EXECUTABLE must be set to specify
PHP executable!");
-}
-
-if (getenv('TEST_PHP_LOG_FORMAT')) {
- $log_format = strtoupper(getenv('TEST_PHP_LOG_FORMAT'));
-} else {
- $log_format = 'LEOD';
-}
-
-if (function_exists('is_executable') && !@is_executable($php)) {
- error("invalid PHP executable specified by TEST_PHP_EXECUTABLE = " .
$php);
-}
-
-// Don't scan system ini files, this may load in extensions from the
-// system /usr/lib/php4 (which may be broken, or an old version, or...)
-$php .= " -n ";
-
-// Check whether a detailed log is wanted.
-if (getenv('TEST_PHP_DETAILED')) {
- define('DETAILED', getenv('TEST_PHP_DETAILED'));
-} else {
- define('DETAILED', 0);
-}
-
-// Check whether user test dirs are requested.
-if (getenv('TEST_PHP_USER')) {
- $user_tests = explode (',', getenv('TEST_PHP_USER'));
-} else {
- $user_tests = array();
-}
-
-// Get info from php
-$info_file = realpath(dirname(__FILE__)) . '/run-test-info.php';
-@unlink($info_file);
-$php_info = '<?php echo "
-PHP_SAPI : " . PHP_SAPI . "
-PHP_VERSION : " . phpversion() . "
-ZEND_VERSION: " . zend_version() . "
-PHP_OS : " . PHP_OS . " - " . php_uname() . "
-INI actual : " . realpath(get_cfg_var("cfg_file_path")) . "
-More .INIs : " . (function_exists(\'php_ini_scanned_files\') ?
str_replace("\n","", php_ini_scanned_files()) : "** not determined **"); ?>';
-save_text($info_file, $php_info);
-$ini_overwrites = array(
- 'mbstring.script_encoding=pass',
- 'output_handler=',
- 'zlib.output_compression=Off',
- 'open_basedir=',
- 'safe_mode=0',
- 'disable_functions=',
- 'output_buffering=Off',
- 'error_reporting=2047',
- 'display_errors=1',
- 'log_errors=0',
- 'html_errors=0',
- 'track_errors=1',
- 'report_memleaks=1',
- 'docref_root=/phpmanual/',
- 'docref_ext=.html',
- 'error_prepend_string=',
- 'error_append_string=',
- 'auto_prepend_file=',
- 'auto_append_file=',
- 'magic_quotes_runtime=0',
- 'session.auto_start=0'
- );
-$info_params = array();
-settings2array($ini_overwrites,$info_params);
-settings2params($info_params);
-$php_info = `$php $info_params $info_file`;
-@unlink($info_file);
-define('TESTED_PHP_VERSION', `$php -r 'echo PHP_VERSION;'`);
-
-// Write test context information.
-
-echo "
-=====================================================================
-CWD : $cwd
-PHP : $php $php_info
-Extra dirs : ";
-foreach ($user_tests as $test_dir) {
- echo "{$test_dir}\n ";
-}
-echo "
-=====================================================================
-";
-
-// Determine the tests to be run.
-
-$test_files = array();
-$test_results = array();
-$GLOBALS['__PHP_FAILED_TESTS__'] = array();
-
-// If parameters given assume they represent selected tests to run.
-if (isset($argc) && $argc > 1) {
- for ($i=1; $i<$argc; $i++) {
- $testfile = realpath($argv[$i]);
- if (is_dir($testfile)) {
- find_files($testfile);
- } else if (preg_match("/\.phpt$/", $testfile)) {
- $test_files[] = $testfile;
- }
- }
- $test_files = array_unique($test_files);
-
- // Run selected tests.
- if (count($test_files)) {
- usort($test_files, "test_sort");
- echo "Running selected tests.\n";
- foreach($test_files AS $name) {
- $test_results[$name] = run_test($php,$name);
- }
- if (getenv('REPORT_EXIT_STATUS') == 1 and ereg('FAILED( |$)',
implode(' ', $test_results))) {
- exit(1);
- }
- exit(0);
- }
-}
-
-// Compile a list of all test files (*.phpt).
-$test_files = array();
-$exts_to_test = get_loaded_extensions();
-$exts_tested = count($exts_to_test);
-$exts_skipped = 0;
-$ignored_by_ext = 0;
-sort($exts_to_test);
-$test_dirs = array('tests', 'pear', 'ext');
-
-foreach ($test_dirs as $dir) {
- find_files("{$cwd}/{$dir}", ($dir == 'ext'));
-}
-
-foreach ($user_tests as $dir) {
- find_files($dir, ($dir == 'ext'));
-}
-
-function find_files($dir,$is_ext_dir=FALSE,$ignore=FALSE)
-{
- global $test_files, $exts_to_test, $ignored_by_ext, $exts_skipped,
$exts_tested;
-
- $o = opendir($dir) or error("cannot open directory: $dir");
- while (($name = readdir($o)) !== FALSE) {
- if (is_dir("{$dir}/{$name}") && !in_array($name, array('.',
'..', 'CVS'))) {
- $skip_ext = ($is_ext_dir && !in_array($name,
$exts_to_test));
- if ($skip_ext) {
- $exts_skipped++;
- }
- find_files("{$dir}/{$name}", FALSE, $ignore ||
$skip_ext);
- }
-
- // Cleanup any left-over tmp files from last run.
- if (substr($name, -4) == '.tmp') {
- @unlink("$dir/$name");
- continue;
- }
-
- // Otherwise we're only interested in *.phpt files.
- if (substr($name, -5) == '.phpt') {
- if ($ignore) {
- $ignored_by_ext++;
- } else {
- $testfile = realpath("{$dir}/{$name}");
- $test_files[] = $testfile;
- }
- }
- }
- closedir($o);
-}
-
-function test_sort($a, $b) {
- global $cwd;
-
- $ta = strpos($a, "{$cwd}/tests")===0 ? 1 + (strpos($a,
"{$cwd}/tests/run-test")===0 ? 1 : 0) : 0;
- $tb = strpos($b, "{$cwd}/tests")===0 ? 1 + (strpos($b,
"{$cwd}/tests/run-test")===0 ? 1 : 0) : 0;
- if ($ta == $tb) {
- return strcmp($a, $b);
- } else {
- return $tb - $ta;
- }
-}
-
-$test_files = array_unique($test_files);
-usort($test_files, "test_sort");
-
-$start_time = time();
-
-echo "TIME START " . date('Y-m-d H:i:s', $start_time) . "
-=====================================================================
-";
-
-foreach ($test_files as $name) {
- $test_results[$name] = run_test($php,$name);
-}
-
-$end_time = time();
-
-// Summarize results
-
-if (0 == count($test_results)) {
- echo "No tests were run.\n";
- return;
-}
-
-$n_total = count($test_results);
-$n_total += $ignored_by_ext;
-
-$sum_results = array('PASSED'=>0, 'WARNED'=>0, 'SKIPPED'=>0, 'FAILED'=>0);
-foreach ($test_results as $v) {
- $sum_results[$v]++;
-}
-$sum_results['SKIPPED'] += $ignored_by_ext;
-$percent_results = array();
-while (list($v,$n) = each($sum_results)) {
- $percent_results[$v] = (100.0 * $n) / $n_total;
-}
-
-echo "
-=====================================================================
-TIME END " . date('Y-m-d H:i:s', $end_time);
-
-$summary = "
-=====================================================================
-TEST RESULT SUMMARY
----------------------------------------------------------------------
-Exts skipped : " . sprintf("%4d",$exts_skipped) . "
-Exts tested : " . sprintf("%4d",$exts_tested) . "
----------------------------------------------------------------------
-Number of tests : " . sprintf("%4d",$n_total) . "
-Tests skipped : " . sprintf("%4d
(%2.1f%%)",$sum_results['SKIPPED'],$percent_results['SKIPPED']) . "
-Tests warned : " . sprintf("%4d
(%2.1f%%)",$sum_results['WARNED'],$percent_results['WARNED']) . "
-Tests failed : " . sprintf("%4d
(%2.1f%%)",$sum_results['FAILED'],$percent_results['FAILED']) . "
-Tests passed : " . sprintf("%4d
(%2.1f%%)",$sum_results['PASSED'],$percent_results['PASSED']) . "
----------------------------------------------------------------------
-Time taken : " . sprintf("%4d seconds", $end_time - $start_time) . "
-=====================================================================
-";
-echo $summary;
-
-$failed_test_summary = '';
-if (count($GLOBALS['__PHP_FAILED_TESTS__'])) {
- $failed_test_summary .= "
-=====================================================================
-FAILED TEST SUMMARY
----------------------------------------------------------------------
-";
- foreach ($GLOBALS['__PHP_FAILED_TESTS__'] as $failed_test_data) {
- $failed_test_summary .= $failed_test_data['test_name'] .
$failed_test_data['info'] . "\n";
- }
- $failed_test_summary .=
"=====================================================================\n";
-}
-
-if ($failed_test_summary && !getenv('NO_PHPTEST_SUMMARY')) {
- echo $failed_test_summary;
-}
-
-define('PHP_QA_EMAIL', 'php-qa-Fj0DB6SUpRUnxqbYAscKCQ@xxxxxxxxxxxxxxxx');
-define('QA_SUBMISSION_PAGE', 'http://qa.php.net/buildtest-process.php');
-
-/* We got failed Tests, offer the user to send and e-mail to QA team, unless
NO_INTERACTION is set */
-if (!getenv('NO_INTERACTION')) {
- $fp = fopen("php://stdin", "r+");
- echo "\nPlease allow this report to be sent to the PHP QA\nteam. This
will give us a better understanding in how\n";
- echo "PHP's test cases are doing. Note that the report will
include\ndetailed configuration data about your system\n";
- echo "so if you are worried about exposing sensitive data,\nsave this
to a file first and remove any sensitive data\n";
- echo "and then send this file to
php-qa-Fj0DB6SUpRVBwYf0OE0KgA@xxxxxxxxxxxxxxxx\n";
- echo "(choose \"s\" to just save the results to a file)? [Yns]: ";
- flush();
- $user_input = fgets($fp, 10);
- $just_save_results = (strtolower($user_input[0]) == 's');
-
- if ($just_save_results || strlen(trim($user_input)) == 0 ||
strtolower($user_input[0]) == 'y') {
- /*
- * Collect information about the host system for our report
- * Fetch phpinfo() output so that we can see the PHP enviroment
- * Make an archive of all the failed tests
- * Send an email
- */
-
- /* Ask the user to provide an email address, so that QA team
can contact the user */
- if (!strncasecmp($user_input, 'y', 1) ||
strlen(trim($user_input)) == 0) {
- echo "\nPlease enter your email address.\n(You address
will be mangled so that it will not go out on any\nmailinglist in plain text):
";
- flush();
- $fp = fopen("php://stdin", "r+");
- $user_email = trim(fgets($fp, 1024));
- $user_email = str_replace("@", " at ", str_replace(".",
" dot ", $user_email));
- }
-
- $failed_tests_data = '';
- $sep = "\n" . str_repeat('=', 80) . "\n";
-
- $failed_tests_data .= $failed_test_summary . "\n";
- $failed_tests_data .= $summary . "\n";
-
- if ($sum_results['FAILED']) {
- foreach ($GLOBALS['__PHP_FAILED_TESTS__'] as
$test_info) {
- $failed_tests_data .= $sep . $test_info['name']
. $test_info['info'];
- $failed_tests_data .= $sep .
file_get_contents(realpath($test_info['output']));
- $failed_tests_data .= $sep .
file_get_contents(realpath($test_info['diff']));
- $failed_tests_data .= $sep . "\n\n";
- }
- $status = "failed";
- } else {
- $status = "success";
- }
-
- $failed_tests_data .= "\n" . $sep . 'BUILD ENVIRONMENT' . $sep;
- $failed_tests_data .= "OS:\n" . PHP_OS . " - " . php_uname() .
"\n\n";
- $ldd = $automake = $autoconf = $libtool = $compiler = 'N/A';
-
- if (substr(PHP_OS, 0, 3) != "WIN") {
- $automake = shell_exec('automake --version');
- $autoconf = shell_exec('autoconf --version');
- /* Always use the generated libtool - Mac OSX uses
'glibtool' */
- $libtool = shell_exec('./libtool --version');
- /* Try the most common flags for 'version' */
- $flags = array('-v', '-V', '--version');
- $cc_status=0;
- foreach($flags AS $flag) {
- system(getenv('CC')." $flag >/dev/null 2>&1",
$cc_status);
- if ($cc_status == 0) {
- $compiler = shell_exec(getenv('CC')."
$flag 2>&1");
- break;
- }
- }
- $ldd = shell_exec("ldd $php");
- }
- $failed_tests_data .= "Automake:\n$automake\n";
- $failed_tests_data .= "Autoconf:\n$autoconf\n";
- $failed_tests_data .= "Libtool:\n$libtool\n";
- $failed_tests_data .= "Compiler:\n$compiler\n";
- $failed_tests_data .= "Bison:\n". @shell_exec('bison
--version'). "\n";
- $failed_tests_data .= "Libraries:\n$ldd\n";
- $failed_tests_data .= "\n";
-
- if (isset($user_email)) {
- $failed_tests_data .= "User's E-mail:
".$user_email."\n\n";
- }
-
- $failed_tests_data .= $sep . "PHPINFO" . $sep;
- $failed_tests_data .= shell_exec($php.' -dhtml_errors=0 -i');
-
- $compression = 0;
-
- if ($just_save_results || !mail_qa_team($failed_tests_data,
$compression, $status)) {
- $output_file = 'php_test_results_' . date('Ymd') . (
$compression ? '.txt.gz' : '.txt' );
- $fp = fopen($output_file, "w");
- fwrite($fp, $failed_tests_data);
- fclose($fp);
-
- if (!$just_save_results) {
- echo "\nThe test script was unable to automatically
send the report to PHP's QA Team\n";
- }
-
- echo "Please send ".$output_file." to ".PHP_QA_EMAIL."
manually, thank you.\n";
- } else {
- fwrite($fp, "\nThank you for helping to make PHP
better.\n");
- fclose($fp);
- }
- }
-}
-
-if (getenv('REPORT_EXIT_STATUS') == 1 and $sum_results['FAILED']) {
- exit(1);
-}
-
-//
-// Send Email to QA Team
-//
-
-function mail_qa_team($data, $compression, $status = FALSE)
-{
- $url_bits = parse_url(QA_SUBMISSION_PAGE);
- if (empty($url_bits['port'])) $url_bits['port'] = 80;
-
- $data = "php_test_data=" .
urlencode(base64_encode(preg_replace("/[\\x00]/", "[0x0]", $data)));
- $data_length = strlen($data);
-
- $fs = fsockopen($url_bits['host'], $url_bits['port'], $errno, $errstr,
10);
- if (!$fs) {
- return FALSE;
- }
-
- $php_version = urlencode(TESTED_PHP_VERSION);
-
- echo "\nPosting to {$url_bits['host']} {$url_bits['path']}\n";
- fwrite($fs, "POST
".$url_bits['path']."?status=$status&version=$php_version HTTP/1.1\r\n");
- fwrite($fs, "Host: ".$url_bits['host']."\r\n");
- fwrite($fs, "User-Agent: QA Browser 0.1\r\n");
- fwrite($fs, "Content-Type: application/x-www-form-urlencoded\r\n");
- fwrite($fs, "Content-Length: ".$data_length."\r\n\r\n");
- fwrite($fs, $data);
- fwrite($fs, "\r\n\r\n");
- fclose($fs);
-
- return 1;
-}
-
-
-//
-// Write the given text to a temporary file, and return the filename.
-//
-
-function save_text($filename,$text)
-{
- $fp = @fopen($filename,'w') or error("Cannot open file '" . $filename .
"' (save_text)");
- fwrite($fp,$text);
- fclose($fp);
- if (1 < DETAILED) echo "
-FILE $filename {{{
-$text
-}}}
-";
-}
-
-//
-// Write an error in a format recognizable to Emacs or MSVC.
-//
-
-function error_report($testname,$logname,$tested)
-{
- $testname = realpath($testname);
- $logname = realpath($logname);
- switch (strtoupper(getenv('TEST_PHP_ERROR_STYLE'))) {
- case 'MSVC':
- echo $testname . "(1) : $tested\n";
- echo $logname . "(1) : $tested\n";
- break;
- case 'EMACS':
- echo $testname . ":1: $tested\n";
- echo $logname . ":1: $tested\n";
- break;
- }
-}
-
-//
-// Run an individual test case.
-//
-
-function run_test($php,$file)
-{
- global $log_format, $info_params, $ini_overwrites;
-
- if (DETAILED) echo "
-=================
-TEST $file
-";
-
- // Load the sections of the test file.
- $section_text = array(
- 'TEST' => '(unnamed test)',
- 'SKIPIF' => '',
- 'GET' => '',
- 'ARGS' => '',
- );
-
- $fp = @fopen($file, "r") or error("Cannot open test file: $file");
-
- $section = '';
- while (!feof($fp)) {
- $line = fgets($fp);
-
- // Match the beginning of a section.
- if (ereg('^--([A-Z]+)--',$line,$r)) {
- $section = $r[1];
- $section_text[$section] = '';
- continue;
- }
-
- // Add to the section text.
- $section_text[$section] .= $line;
- }
- fclose($fp);
-
- /* For GET/POST tests, check if cgi sapi is avaliable and if it is, use
it. */
- if ((!empty($section_text['GET']) || !empty($section_text['POST']))) {
- if (file_exists("./sapi/cgi/php")) {
- $old_php = $php;
- $php = realpath("./sapi/cgi/php") . ' -C ';
- }
- }
-
- $shortname = str_replace($GLOBALS['cwd'].'/', '', $file);
- $tested = trim($section_text['TEST'])." [$shortname]";
-
- $tmp = realpath(dirname($file));
- $tmp_skipif = $tmp . uniqid('/phpt.');
- $tmp_file = ereg_replace('\.phpt$','.php',$file);
- $tmp_post = $tmp . uniqid('/phpt.');
-
- @unlink($tmp_skipif);
- @unlink($tmp_file);
- @unlink($tmp_post);
-
- // unlink old test results
- @unlink(ereg_replace('\.phpt$','.diff',$file));
- @unlink(ereg_replace('\.phpt$','.log',$file));
- @unlink(ereg_replace('\.phpt$','.exp',$file));
- @unlink(ereg_replace('\.phpt$','.out',$file));
-
- // Reset environment from any previous test.
- putenv("REDIRECT_STATUS=");
- putenv("QUERY_STRING=");
- putenv("PATH_TRANSLATED=");
- putenv("SCRIPT_FILENAME=");
- putenv("REQUEST_METHOD=");
- putenv("CONTENT_TYPE=");
- putenv("CONTENT_LENGTH=");
-
- // Check if test should be skipped.
- $info = '';
- $warn = false;
- if (array_key_exists('SKIPIF', $section_text)) {
- if (trim($section_text['SKIPIF'])) {
- save_text($tmp_skipif, $section_text['SKIPIF']);
- $extra = substr(PHP_OS, 0, 3) !== "WIN" ?
- "unset REQUEST_METHOD;": "";
-
- $output = `$extra $php $info_params -f $tmp_skipif`;
- @unlink($tmp_skipif);
- if (eregi("^skip", trim($output))) {
- echo "SKIP $tested";
- $reason = (eregi("^skip[[:space:]]*(.+)\$",
trim($output))) ? eregi_replace("^skip[[:space:]]*(.+)\$", "\\1",
trim($output)) : FALSE;
- if ($reason) {
- echo " (reason: $reason)\n";
- } else {
- echo "\n";
- }
- if (isset($old_php)) {
- $php = $old_php;
- }
- return 'SKIPPED';
- }
- if (eregi("^info", trim($output))) {
- $reason = (ereg("^info[[:space:]]*(.+)\$",
trim($output))) ? ereg_replace("^info[[:space:]]*(.+)\$", "\\1", trim($output))
: FALSE;
- if ($reason) {
- $info = " (info: $reason)";
- }
- }
- if (eregi("^warn", trim($output))) {
- $reason = (ereg("^warn[[:space:]]*(.+)\$",
trim($output))) ? ereg_replace("^warn[[:space:]]*(.+)\$", "\\1", trim($output))
: FALSE;
- if ($reason) {
- $warn = true; /* only if there is a
reason */
- $info = " (warn: $reason)";
- }
- }
- }
- }
-
- // Default ini settings
- $ini_settings = array();
- // additional ini overwrites
- //$ini_overwrites[] = 'setting=value';
- settings2array($ini_overwrites, $ini_settings);
-
- // Any special ini settings
- // these may overwrite the test defaults...
- if (array_key_exists('INI', $section_text)) {
- settings2array(preg_split( "/[\n\r]+/", $section_text['INI']),
$ini_settings);
- }
- settings2params($ini_settings);
-
- // We've satisfied the preconditions - run the test!
- save_text($tmp_file,$section_text['FILE']);
- if (array_key_exists('GET', $section_text)) {
- $query_string = trim($section_text['GET']);
- } else {
- $query_string = '';
- }
-
- putenv("REDIRECT_STATUS=1");
- putenv("QUERY_STRING=$query_string");
- putenv("PATH_TRANSLATED=$tmp_file");
- putenv("SCRIPT_FILENAME=$tmp_file");
-
- $args = $section_text['ARGS'] ? ' -- '.$section_text['ARGS'] : '';
-
- if (array_key_exists('POST', $section_text) &&
!empty($section_text['POST'])) {
-
- $post = trim($section_text['POST']);
- save_text($tmp_post,$post);
- $content_length = strlen($post);
-
- putenv("REQUEST_METHOD=POST");
- putenv("CONTENT_TYPE=application/x-www-form-urlencoded");
- putenv("CONTENT_LENGTH=$content_length");
-
- $cmd = "$php$ini_settings -f \"$tmp_file\" 2>&1 < $tmp_post";
-
- } else {
-
- putenv("REQUEST_METHOD=GET");
- putenv("CONTENT_TYPE=");
- putenv("CONTENT_LENGTH=");
-
- $cmd = "$php$ini_settings -f \"$tmp_file\" $args 2>&1";
- }
-
- if (DETAILED) echo "
-CONTENT_LENGTH = " . getenv("CONTENT_LENGTH") . "
-CONTENT_TYPE = " . getenv("CONTENT_TYPE") . "
-PATH_TRANSLATED = " . getenv("PATH_TRANSLATED") . "
-QUERY_STRING = " . getenv("QUERY_STRING") . "
-REDIRECT_STATUS = " . getenv("REDIRECT_STATUS") . "
-REQUEST_METHOD = " . getenv("REQUEST_METHOD") . "
-SCRIPT_FILENAME = " . getenv("SCRIPT_FILENAME") . "
-COMMAND $cmd
-";
-
- $out = `$cmd`;
-
- @unlink($tmp_post);
-
- // Does the output match what is expected?
- $output = trim($out);
- $output = preg_replace('/\r\n/',"\n",$output);
-
- $old_php="/usr/bin/php";
-
- /* when using CGI, strip the headers from the output */
- if (isset($old_php) && ($pos = strpos($output, "\n\n")) !== FALSE) {
- $output = substr($output, ($pos + 2));
- }
-
- if (isset($section_text['EXPECTF']) ||
isset($section_text['EXPECTREGEX'])) {
- if (isset($section_text['EXPECTF'])) {
- $wanted = trim($section_text['EXPECTF']);
- } else {
- $wanted = trim($section_text['EXPECTREGEX']);
- }
- $wanted_re = preg_replace('/\r\n/',"\n",$wanted);
- if (isset($section_text['EXPECTF'])) {
- $wanted_re = preg_quote($wanted_re, '/');
- // Stick to basics
- $wanted_re = str_replace("%s", ".+?", $wanted_re);
//not greedy
- $wanted_re = str_replace("%i", "[+\-]?[0-9]+",
$wanted_re);
- $wanted_re = str_replace("%d", "[0-9]+", $wanted_re);
- $wanted_re = str_replace("%x", "[0-9a-fA-F]+",
$wanted_re);
- $wanted_re = str_replace("%f",
"[+\-]?\.?[0-9]+\.?[0-9]*(E-?[0-9]+)?", $wanted_re);
- $wanted_re = str_replace("%c", ".", $wanted_re);
- // %f allows two points "-.0.0" but that is the best
*simple* expression
- }
-/* DEBUG YOUR REGEX HERE
- var_dump($wanted_re);
- print(str_repeat('=', 80) . "\n");
- var_dump($output);
-*/
- if (preg_match("/^$wanted_re\$/s", $output)) {
- @unlink($tmp_file);
- echo "PASS $tested$info\n";
- if (isset($old_php)) {
- $php = $old_php;
- }
- return 'PASSED';
- }
-
- } else {
- $wanted = trim($section_text['EXPECT']);
- $wanted = preg_replace('/\r\n/',"\n",$wanted);
- // compare and leave on success
- $ok = (0 == strcmp($output,$wanted));
- if ($ok) {
- @unlink($tmp_file);
- echo "PASS $tested$info\n";
- if (isset($old_php)) {
- $php = $old_php;
- }
- return 'PASSED';
- }
- }
-
- // Test failed so we need to report details.
- if ($warn) {
- echo "WARN $tested$info\n";
- } else {
- echo "FAIL $tested$info\n";
- }
-
- $GLOBALS['__PHP_FAILED_TESTS__'][] = array(
- 'name' => $file,
- 'test_name' => $tested,
- 'output' =>
ereg_replace('\.phpt$','.log', $file),
- 'diff' =>
ereg_replace('\.phpt$','.diff', $file),
- 'info' => $info
- );
-
- // write .exp
- if (strpos($log_format,'E') !== FALSE) {
- $logname = ereg_replace('\.phpt$','.exp',$file);
- $log = fopen($logname,'w') or error("Cannot create test log -
$logname");
- fwrite($log,$wanted);
- fclose($log);
- }
-
- // write .out
- if (strpos($log_format,'O') !== FALSE) {
- $logname = ereg_replace('\.phpt$','.out',$file);
- $log = fopen($logname,'w') or error("Cannot create test log -
$logname");
- fwrite($log,$output);
- fclose($log);
- }
-
- // write .diff
- if (strpos($log_format,'D') !== FALSE) {
- $logname = ereg_replace('\.phpt$','.diff',$file);
- $log = fopen($logname,'w') or error("Cannot create test log -
$logname");
- fwrite($log,generate_diff($wanted,$output));
- fclose($log);
- }
-
- // write .log
- if (strpos($log_format,'L') !== FALSE) {
- $logname = ereg_replace('\.phpt$','.log',$file);
- $log = fopen($logname,'w') or error("Cannot create test log -
$logname");
- fwrite($log,"
----- EXPECTED OUTPUT
-$wanted
----- ACTUAL OUTPUT
-$output
----- FAILED
-");
- fclose($log);
- error_report($file,$logname,$tested);
- }
-
- if (isset($old_php)) {
- $php = $old_php;
- }
-
- return $warn ? 'WARNED' : 'FAILED';
-}
-
-function generate_diff($wanted,$output)
-{
- $w = explode("\n", $wanted);
- $o = explode("\n", $output);
- $w1 = array_diff_assoc($w,$o);
- $o1 = array_diff_assoc($o,$w);
- $w2 = array();
- $o2 = array();
- foreach($w1 as $idx => $val) $w2[sprintf("%03d<",$idx)] =
sprintf("%03d- ", $idx+1).$val;
- foreach($o1 as $idx => $val) $o2[sprintf("%03d>",$idx)] =
sprintf("%03d+ ", $idx+1).$val;
- $diff = array_merge($w2, $o2);
- ksort($diff);
- return implode("\r\n", $diff);
-}
-
-function error($message)
-{
- echo "ERROR: {$message}\n";
- exit(1);
-}
-
-function settings2array($settings, &$ini_settings)
-{
- foreach($settings as $setting) {
- if (strpos($setting, '=')!==false) {
- $setting = explode("=", $setting, 2);
- $name = trim(strtolower($setting[0]));
- $value = trim($setting[1]);
- $ini_settings[$name] = $value;
- }
- }
-}
-
-function settings2params(&$ini_settings)
-{
- if (count($ini_settings)) {
- $settings = '';
- foreach($ini_settings as $name => $value) {
- $value = addslashes($value);
- $settings .= " -d \"$name=$value\"";
- }
- $ini_settings = $settings;
- } else {
- $ini_settings = '';
- }
-}
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: fdm=marker
- * vim: noet sw=4 ts=4
- */
-?>
Index: libmysequoia/test-suite/php5/README
diff -u libmysequoia/test-suite/php5/README:1.5
libmysequoia/test-suite/php5/README:removed
--- libmysequoia/test-suite/php5/README:1.5 Fri Feb 24 12:53:58 2006
+++ libmysequoia/test-suite/php5/README Tue Mar 21 06:39:05 2006
@@ -1,222 +0,0 @@
-Steps to run the tests:
-
-Prerequisites for Debian (stable version):
-fakeroot, devscripts, debhelper, autotools-dev, doxygen, dpatch,
-libxml2-dev, zlib1g-dev, graphviz, autoconf, automake1.9, libtool,
-libmysqlclient15-dev, libcppunit-dev, lcov
-(and maybe other)
-
-1. Install php5, mysql5, carob and libmysequoia
-
-Ubuntu:
-
-- Add the following to your /etc/apt/sources.list:
- ### MySQL 5 and PHP 5 repository for Ubuntu
- deb http://ftp.yi.se/pub/software/dotdeb/ stable all
- deb-src http://ftp.yi.se/pub/software/dotdeb/ stable all
-
- ### Continuent repository
- deb http://carob.continuent.org/repo/debian/ binary/
- deb-src http://carob.continuent.org/repo/debian/ source/
-
-- apt-get update
- apt-get install mysql-server-5.0 mysql-client-5.0 libmysqlclient15-dev
- apt-get install php5 php5-cli php5-mysqli
- apt-get install libmysequoia libmysequoia-dev
-
-Debian:
-
-- Add the following to your /etc/apt/sources.list:
- # MySQL 5 and PHP 5 repository for Debian (backport to stable)
- deb http://packages.dotdeb.org/ stable all
- deb-src http://sources.dotdeb.org/ stable all
-
-- apt-get update
- apt-get install mysql-server-5.0 mysql-client-5.0 libmysqlclient15-dev
- apt-get install php5 php5-cli php5-mysqli
- apt-get install libmysequoia libmysequoia-dev
-
-- if no package is available, rebuild deb from source:
- * install log4cxx: not in stable, must be recomplied from testing:
- - download .dsc .diff .tgz.orig files
- - dpkg-buildpackage -x .dsc
- - cd log4cxx-x.y
- - debuild
-
- * carob
- cd carob/
- debuild
- then install the 2 packages
-
- * libmysequoia
- cd libmysequoia
- ./autogen.sh
- debuild
-
-Red Hat Enterprise ES:
-
-- Install MySQL 5
- Use rpms from MySQL web site (including dev package).
-
-- Install log4cxx rpm (this is NOT provided and must be rebuilt from source):
- * download log4cxx-0.9.7-6.src.rpm from xmlbeansxx SourceForge project
- * rpm -i rpm -i log4cxx-0.9.7-6.src.rpm
- * edit /usr/src/redhat/SPECS/log4cxx.spec file
- - %build
- ./autogen.sh
- chmod a+x ./configure <-- add this line
- ./configure --prefix=/usr --enable-ltdl-convenience
- - comment patch appliance (does not seem to work)
- #Patch0: %{name}-touk-main.patch
- #%patch0 -p1
- - add missing files:
- %files
- (...)
- %{_bindir}/simplesocketserver
-
- %files devel
- (...)
- %{_libdir}/liblog4cxx.la
- * rpmbuild -ba log4cxx.spec
- * cd /usr/src/redhat/RPMS/i386
- rpm -i log4cxx-0.9.7-6.i386.rpm log4cxx-devel-0.9.7-6.i386.rpm
-
-- Install Carob rpm
- * download carob module dir from CVS
- * rename carob into carob-0.0.1 and create:
- /usr/src/redhat/SOURCES/carob-0.0.1.tar.gz
- * rpmbuild -ba carob.spec
- * rpm -i carob-0.0.1-1.i386.rpm carob-devel-0.0.1-1.i386.rpm
-
-- Install libmysequoia
- * download libmysequoia module from CVS
- * cd libmysequoia
- ./autogen.sh
- ./configure --disable-cppunit --disable-gcov
- make dist
- rpmbuild -ta libmysequoia-0.7.tar.gz
- rpm -i /usr/src/redhat/RPMS/i386/libmysequoia-devel-0.7-1.i386.rpm
- rpm -i /usr/src/redhat/RPMS/i386/libmysequoia-0.7-1.i386.rpm
-
-- Install php5
- Should be the same version than the test suite (5.1.12). Below are
- instructions to recompile rpm from source. In any case, php5-mysqli
- must be recompiled against libmysequoia lib (see 2.)
-
- * download src.rpm from http://rpm.pbone.net/
- * rpm -i php-5.1.2-4.src.rpm
- * edit PHP spec file: here is the diff:
-
-[root@node1 SPECS]# diff -u php.spec.orig php.spec
---- php.spec.save 2006-02-23 18:52:36.741190296 +0100
-+++ php.spec 2006-02-23 17:00:27.557181760 +0100
-@@ -35,7 +35,7 @@
- BuildRequires: bzip2-devel, curl-devel >= 7.9, db4-devel, expat-devel
- BuildRequires: gmp-devel, aspell-devel >= 0.50.0
- BuildRequires: httpd-devel >= 2.0.46-1, libjpeg-devel, libpng-devel, pam-devel
--BuildRequires: libstdc++-devel, openssl-devel, sqlite-devel >= 3.0.0
-+BuildRequires: libstdc++-devel, openssl-devel
- BuildRequires: zlib-devel, pcre-devel >= 4.5, smtpdaemon
- BuildRequires: bzip2, fileutils, file >= 4.0, perl, libtool >= 1.4.3, gcc-c++
- Obsoletes: php-dbg, mod_php, php3, phpfi, stronghold-php, php-openssl
-@@ -288,7 +288,7 @@
- # Regenerate configure scripts (patches change config.m4's)
- ./buildconf --force
-
--CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -Wno-pointer-sign"
-+CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
- export CFLAGS
-
- # Install extension modules in %{_libdir}/php/modules.
-@@ -376,11 +376,11 @@
- --with-xmlrpc=shared \
- --with-ldap=shared \
- --with-mysql=shared,%{_prefix} \
-- --with-mysqli=shared,%{_bindir}/mysql_config \
-+ --with-mysqli=shared,%{_bindir}/mysequoia_config \
- --enable-dom=shared \
- --with-dom-xslt=%{_prefix} --with-dom-exslt=%{_prefix} \
- --with-pgsql=shared \
-- --with-snmp=shared,%{_prefix} \
-+ --with-snmp=no \
- --enable-soap=shared \
- --with-xsl=shared,%{_prefix} \
- --enable-xmlreader=shared --enable-xmlwriter=shared \
-@@ -389,7 +389,7 @@
- --with-pdo-odbc=shared,unixODBC,%{_prefix} \
- --with-pdo-mysql=shared,%{_prefix} \
- --with-pdo-pgsql=shared,%{_prefix} \
-- --with-pdo-sqlite=shared,%{_prefix}
-+ --with-pdo-sqlite=no
- popd
-
- # Build Apache module, and the CLI SAPI, /usr/bin/php
-@@ -525,7 +525,9 @@
- %files odbc -f files.odbc
- %files imap -f files.imap
- %files ldap -f files.ldap
--%files snmp -f files.snmp
-+#%files snmp -f files.snmp
-+%files snmp
-+%config(noreplace) %attr(644,root,root) /etc/php.d/snmp.ini
- %files xml -f files.xml
- %files xmlrpc -f files.xmlrpc
- %files mbstring -f files.mbstring
-@@ -534,7 +536,11 @@
- %files soap -f files.soap
- %files bcmath -f files.bcmath
- %files dba -f files.dba
--%files pdo -f files.pdo
-+#%files pdo -f files.pdo
-+%files pdo
-+%attr(755,root,root) /usr/lib/php/modules/pdo.so
-+%config(noreplace) %attr(644,root,root) /etc/php.d/pdo.ini
-+%config(noreplace) %attr(644,root,root) /etc/php.d/pdo_sqlite.ini
-
- %changelog
- * Tue Jan 31 2006 Joe Orton <jorton-H+wXaHxf7aLQT0dZR+AlfA@xxxxxxxxxxxxxxxx>
5.1.2-4
-
- * rpm -i php5 (you may have to use force to install pear from php4)
-
-
-2. Recompile mysqli
-
-Ubuntu
-
-- apt-get source php5
- Recompile PHP replacing mysql_config with mysequoia_config and replace
/usr/lib/php5/20050922/mysqli.so with
- ext/mysqli/.libs/mysqli.so
-
-Debian
-
-- apt-get source php5- cd php5.x.y/debian
-- edit rules file:
- Replace:
- --with-mysqli=shared,/usr/bin/mysql_config \
- by:
- --with-mysqli=shared,/usr/bin/mysequoia_config \
-- edit control file (Build-Depends line):
- libmysqlclient12-dev -> libmysqlclient15-dev
- automake1.4 -> automake1.9
-- debuild (Dependencies may have to be installed if needed: apt-get builddep
php5)
- Warning: if the build is failing, you have most likely to redownload
- the source (some pacths may be applied several times)
-- reinstall php5-mysqli with the new package
-- modify /etc/php5/cli/php.ini: add extension=mysqli.so
-
-Red Hat Enterprise ES
-
-Already done if you have installed php5 using 1. instructions.
-
-
-3. Start your cluster and load a virtual database named 'test'
-
-
-4. ./run to run all the tests or simply ./run 001.phpt to run only the
001.phpt test
-
-5. create $HOME/.my.cnf file with the following content:
- [client]
- user=root
- password=rootpass
- host=localhost
- database=test
Index: libmysequoia/test-suite/php5/mysql/001.phpt
diff -u libmysequoia/test-suite/php5/mysql/001.phpt:1.1
libmysequoia/test-suite/php5/mysql/001.phpt:removed
--- libmysequoia/test-suite/php5/mysql/001.phpt:1.1 Wed Feb 1 10:57:20 2006
+++ libmysequoia/test-suite/php5/mysql/001.phpt Tue Mar 21 06:39:05 2006
@@ -1,30 +0,0 @@
---TEST--
-mysql connect
---SKIPIF--
-<?php include 'skipif.inc'; ?>
---FILE--
-<?php
-
-include 'connect.inc';
-$test = '';
-
-/*** test mysql_connect 127.0.0.1 ***/
-$db = mysql_connect('127.0.0.1', $user, $passwd);
-$test .= ($db) ? '1' : '0';
-mysql_close($db);
-
-/*** test mysql_connect localhost ***/
-$db = mysql_connect($host, $user, $passwd);
-$test .= ($db) ? '1' : '0';
-mysql_close($db);
-
-/*** test mysql_connect localhost:port ***/
-$db = mysql_connect("{$host}:3306", $user, $passwd, '');
-$test .= ($db) ? '1' : '0';
-mysql_close($db);
-
-var_dump($test);
-
-?>
---EXPECT--
-string(3) "111"
Index: libmysequoia/test-suite/php5/mysql/002.phpt
diff -u libmysequoia/test-suite/php5/mysql/002.phpt:1.1
libmysequoia/test-suite/php5/mysql/002.phpt:removed
--- libmysequoia/test-suite/php5/mysql/002.phpt:1.1 Wed Feb 1 10:57:20 2006
+++ libmysequoia/test-suite/php5/mysql/002.phpt Tue Mar 21 06:39:05 2006
@@ -1,53 +0,0 @@
---TEST--
-mysql_fetch_array
---SKIPIF--
-<?php include 'skipif.inc'; ?>
---FILE--
-<?php
-
-include 'connect.inc';
-
-$db = mysql_connect($host, $user, $passwd);
-
-var_dump($db);
-
-var_dump(mysql_select_db('test'));
-
-var_dump(mysql_query('DROP TABLE IF EXISTS test'));
-
-var_dump(mysql_query('CREATE TABLE test(col1 int PRIMARY KEY, col2
varchar(50), col3 char(5))'));
-
-var_dump(mysql_query("INSERT INTO test(col1, col2, col3) VALUES(1, 'foo',
'bar'),(2, 'foo', 'bar')"));
-
-var_dump($res = mysql_query('SELECT col1, col2, col3 FROM test ORDER BY col1
ASC'));
-
-while ($data = mysql_fetch_array($res, MYSQL_ASSOC)) {
- var_dump($data);
-}
-
-mysql_close($db);
-
-?>
---EXPECTF--
-resource(%d) of type (mysql link)
-bool(true)
-bool(true)
-bool(true)
-bool(true)
-resource(%d) of type (mysql result)
-array(3) {
- ["col1"]=>
- string(1) "1"
- ["col2"]=>
- string(3) "foo"
- ["col3"]=>
- string(3) "bar"
-}
-array(3) {
- ["col1"]=>
- string(1) "2"
- ["col2"]=>
- string(3) "foo"
- ["col3"]=>
- string(3) "bar"
-}
Index: libmysequoia/test-suite/php5/mysql/003.phpt
diff -u libmysequoia/test-suite/php5/mysql/003.phpt:1.1
libmysequoia/test-suite/php5/mysql/003.phpt:removed
--- libmysequoia/test-suite/php5/mysql/003.phpt:1.1 Wed Feb 1 10:57:20 2006
+++ libmysequoia/test-suite/php5/mysql/003.phpt Tue Mar 21 06:39:05 2006
@@ -1,84 +0,0 @@
---TEST--
-mysql_fetch_object
---SKIPIF--
-<?php include 'skipif.inc'; ?>
---FILE--
-<?php
-
-include 'connect.inc';
-
-class class24 {
- function __construct() {
- echo __METHOD__ . "\n";
- }
-}
-
-$data = array(
- "one",
- "two",
- "three"
- );
-
-$db = mysql_connect($host, $user, $passwd);
-
-mysql_select_db("test");
-
-mysql_query('DROP TABLE IF EXISTS test');
-
-mysql_query("CREATE TABLE test(a varchar(10))");
-
-foreach ($data as $str) {
- mysql_query("INSERT INTO test VALUES('$str')");
- var_dump($str);
-}
-
-echo "==stdClass==\n";
-$res = mysql_query("SELECT a FROM test");
-while ($obj = mysql_fetch_object($res)) {
- var_dump($obj);
-}
-
-echo "==class24==\n";
-$res = mysql_query("SELECT a FROM test");
-while ($obj = mysql_fetch_object($res, 'class24')) {
- var_dump($obj);
-}
-
-mysql_close($db);
-
-?>
-==DONE==
---EXPECTF--
-string(3) "one"
-string(3) "two"
-string(5) "three"
-==stdClass==
-object(stdClass)#%d (1) {
- ["a"]=>
- string(3) "one"
-}
-object(stdClass)#%d (1) {
- ["a"]=>
- string(3) "two"
-}
-object(stdClass)#%d (1) {
- ["a"]=>
- string(5) "three"
-}
-==class24==
-class24::__construct
-object(class24)#%d (1) {
- ["a"]=>
- string(3) "one"
-}
-class24::__construct
-object(class24)#%d (1) {
- ["a"]=>
- string(3) "two"
-}
-class24::__construct
-object(class24)#%d (1) {
- ["a"]=>
- string(5) "three"
-}
-==DONE==
Index: libmysequoia/test-suite/php5/mysql/connect.inc
diff -u libmysequoia/test-suite/php5/mysql/connect.inc:1.1
libmysequoia/test-suite/php5/mysql/connect.inc:removed
--- libmysequoia/test-suite/php5/mysql/connect.inc:1.1 Wed Feb 1 10:57:20 2006
+++ libmysequoia/test-suite/php5/mysql/connect.inc Tue Mar 21 06:39:05 2006
@@ -1,10 +0,0 @@
-<?php
-
- /* default values are localhost, root and empty password
- Change the values if you use another configuration */
-
- $host = "localhost";
- $user = "root";
- $passwd = "rootpass";
-
-?>
Index: libmysequoia/test-suite/php5/mysql/skipif.inc
diff -u libmysequoia/test-suite/php5/mysql/skipif.inc:1.1
libmysequoia/test-suite/php5/mysql/skipif.inc:removed
--- libmysequoia/test-suite/php5/mysql/skipif.inc:1.1 Wed Feb 1 10:57:20 2006
+++ libmysequoia/test-suite/php5/mysql/skipif.inc Tue Mar 21 06:39:05 2006
@@ -1,8 +0,0 @@
-<?php
-
-include 'connect.inc';
-$link = @mysql_connect($host, $user, $passwd);
-if (!$link) die('skip cannot connect');
-mysql_close($link);
-
-?>
\ No newline at end of file
Index: libmysequoia/test-suite/php5/mysqli/.cvsignore
diff -u libmysequoia/test-suite/php5/mysqli/.cvsignore:1.1
libmysequoia/test-suite/php5/mysqli/.cvsignore:removed
--- libmysequoia/test-suite/php5/mysqli/.cvsignore:1.1 Wed Feb 22 14:41:45 2006
+++ libmysequoia/test-suite/php5/mysqli/.cvsignore Tue Mar 21 06:39:05 2006
@@ -1,4 +0,0 @@
-*.diff
-*.exp
-*.out
-*.php
Index: libmysequoia/test-suite/php5/mysqli/001.phpt
diff -u libmysequoia/test-suite/php5/mysqli/001.phpt:1.1
libmysequoia/test-suite/php5/mysqli/001.phpt:removed
--- libmysequoia/test-suite/php5/mysqli/001.phpt:1.1 Wed Feb 1 10:57:20 2006
+++ libmysequoia/test-suite/php5/mysqli/001.phpt Tue Mar 21 06:39:05 2006
@@ -1,47 +0,0 @@
---TEST--
-mysqli connect
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
-<?php require_once('skipifemb.inc'); ?>
---FILE--
-<?php
- include "connect.inc";
-
- $dbname = "test";
- $test = "";
-
- /*** test mysqli_connect localhost:port ***/
- $link = mysqli_connect($host, $user, $passwd, "", 3306);
- $test .= ($link) ? "1" : "0";
- mysqli_close($link);
-
- /*** test mysqli_real_connect ***/
- $link = mysqli_init();
- $test.= (mysqli_real_connect($link, $host, $user, $passwd))
- ? "1" : "0";
- mysqli_close($link);
-
- /*** test mysqli_real_connect with db ***/
- $link = mysqli_init();
- $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname))
- ? "1" : "0";
- mysqli_close($link);
-
- /*** test mysqli_real_connect with port ***/
- $link = mysqli_init();
- $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname,
3306))
- ? "1":"0";
- mysqli_close($link);
-
- /*** test mysqli_real_connect compressed ***/
- $link = mysqli_init();
- $test .= (mysqli_real_connect($link, $host, $user, $passwd, $dbname, 0,
NULL, MYSQLI_CLIENT_COMPRESS))
- ? "1" : "0";
- mysqli_close($link);
-
- /* todo ssl connections */
-
- var_dump($test);
-?>
---EXPECT--
-string(5) "11111"
Index: libmysequoia/test-suite/php5/mysqli/002.phpt
diff -u libmysequoia/test-suite/php5/mysqli/002.phpt:1.1
libmysequoia/test-suite/php5/mysqli/002.phpt:removed
--- libmysequoia/test-suite/php5/mysqli/002.phpt:1.1 Wed Feb 1 10:57:20 2006
+++ libmysequoia/test-suite/php5/mysqli/002.phpt Tue Mar 21 06:39:05 2006
@@ -1,62 +0,0 @@
---TEST--
-mysqli bind_result 1
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
- include "connect.inc";
-
- /*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
-
- mysqli_select_db($link, "test");
- $rc = mysqli_query($link,"DROP TABLE IF EXISTS test_fetch_null");
-
- $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))");
-
- $rc = mysqli_query($link,"INSERT INTO test_fetch_null(col1,col10,
col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)");
-
- $stmt = mysqli_prepare($link, "SELECT col1, col2, col3, col4, col5,
col6, col7, col8, col9, col10, col11 from test_fetch_null");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9,
$c10, $c11);
- mysqli_execute($stmt);
-
- mysqli_fetch($stmt);
-
- $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11);
-
- var_dump($test);
-
- mysqli_stmt_close($stmt);
- mysqli_close($link);
-?>
---EXPECT--
-array(11) {
- [0]=>
- int(1)
- [1]=>
- NULL
- [2]=>
- NULL
- [3]=>
- NULL
- [4]=>
- NULL
- [5]=>
- NULL
- [6]=>
- NULL
- [7]=>
- NULL
- [8]=>
- NULL
- [9]=>
- string(4) "foo1"
- [10]=>
- string(4) "1000"
-}
Index: libmysequoia/test-suite/php5/mysqli/003.phpt
diff -u libmysequoia/test-suite/php5/mysqli/003.phpt:1.1
libmysequoia/test-suite/php5/mysqli/003.phpt:removed
--- libmysequoia/test-suite/php5/mysqli/003.phpt:1.1 Wed Feb 1 10:57:20 2006
+++ libmysequoia/test-suite/php5/mysqli/003.phpt Tue Mar 21 06:39:05 2006
@@ -1,58 +0,0 @@
---TEST--
-mysqli connect
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
- include "connect.inc";
-
- /*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd, "test");
-
- mysqli_query($link, "SET sql_mode=''");
-
- mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result");
- 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))");
-
- 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')");
-
-
- $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
-
- $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
-
- var_dump($test);
-
- mysqli_stmt_close($stmt);
- mysqli_close($link);
-?>
---EXPECT--
-array(7) {
- [0]=>
- string(10) "2002-01-02"
- [1]=>
- string(8) "12:49:00"
- [2]=>
- string(19) "2002-01-02 17:46:59"
- [3]=>
- int(2010)
- [4]=>
- string(19) "2010-07-10 00:00:00"
- [5]=>
- string(19) "0000-00-00 00:00:00"
- [6]=>
- string(19) "1999-12-29 00:00:00"
-}
Index: libmysequoia/test-suite/php5/mysqli/004.phpt
diff -u libmysequoia/test-suite/php5/mysqli/004.phpt:1.1
libmysequoia/test-suite/php5/mysqli/004.phpt:removed
--- libmysequoia/test-suite/php5/mysqli/004.phpt:1.1 Wed Feb 1 10:57:20 2006
+++ libmysequoia/test-suite/php5/mysqli/004.phpt Tue Mar 21 06:39:05 2006
@@ -1,60 +0,0 @@
---TEST--
-mysqli fetch char/text
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
- include ("connect.inc");
-
- /*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
-
- mysqli_select_db($link, "test");
-
- 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, "INSERT INTO test_bind_fetch VALUES ('1234567890',
'this is a test0')");
- mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567891',
'this is a test1')");
- mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567892',
'this is a test2')");
- mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567893',
'this is a test3')");
-
- $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch ORDER BY
c1");
- mysqli_bind_result($stmt, $c1, $c2);
- mysqli_execute($stmt);
- $i=4;
- while ($i--) {
- mysqli_fetch($stmt);
- $test = array($c1,$c2);
- var_dump($test);
- }
-
-
- mysqli_stmt_close($stmt);
- mysqli_close($link);
-?>
---EXPECT--
-array(2) {
- [0]=>
- string(10) "1234567890"
- [1]=>
- string(15) "this is a test0"
-}
-array(2) {
- [0]=>
- string(10) "1234567891"
- [1]=>
- string(15) "this is a test1"
-}
-array(2) {
- [0]=>
- string(10) "1234567892"
- [1]=>
- string(15) "this is a test2"
-}
-array(2) {
- [0]=>
- string(10) "1234567893"
- [1]=>
- string(15) "this is a test3"
-}
Index: libmysequoia/test-suite/php5/mysqli/005.phpt
diff -u libmysequoia/test-suite/php5/mysqli/005.phpt:1.1
libmysequoia/test-suite/php5/mysqli/005.phpt:removed
--- libmysequoia/test-suite/php5/mysqli/005.phpt:1.1 Wed Feb 1 10:57:20 2006
+++ libmysequoia/test-suite/php5/mysqli/005.phpt Tue Mar 21 06:39:05 2006
@@ -1,40 +0,0 @@
---TEST--
-mysqli fetch char/text long
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
- include "connect.inc";
-
- /*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
-
- mysqli_select_db($link, "test");
-
- mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch");
- mysqli_query($link,"CREATE TABLE test_bind_fetch(c1 char(10), c2
text)");
-
- $a = str_repeat("A1", 32000);
-
- mysqli_query($link, "INSERT INTO test_bind_fetch VALUES ('1234567890',
'$a')");
-
- $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
- mysqli_bind_result($stmt, $c1, $c2);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
-
- $test[] = $c1;
- $test[] = ($a == $c2) ? "32K String ok" : "32K String failed";
-
- var_dump($test);
-
- mysqli_stmt_close($stmt);
- mysqli_close($link);
-?>
---EXPECT--
-array(2) {
- [0]=>
- string(10) "1234567890"
- [1]=>
- string(13) "32K String ok"
-}
Index: libmysequoia/test-suite/php5/mysqli/006.phpt
diff -u libmysequoia/test-suite/php5/mysqli/006.phpt:1.1
libmysequoia/test-suite/php5/mysqli/006.phpt:removed
--- libmysequoia/test-suite/php5/mysqli/006.phpt:1.1 Wed Feb 1 10:57:20 2006
+++ libmysequoia/test-suite/php5/mysqli/006.phpt Tue Mar 21 06:39:05 2006
@@ -1,54 +0,0 @@
---TEST--
-mysqli fetch long values
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
- include "connect.inc";
-
- /*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
-
- mysqli_select_db($link, "test");
- 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, "INSERT INTO test_bind_fetch VALUES
(-23,35999,NULL,-500,-9999999,-0,0)");
-
- $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
-
- $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
-
- var_dump($test);
-
- mysqli_stmt_close($stmt);
- mysqli_close($link);
-?>
---EXPECT--
-array(7) {
- [0]=>
- int(0)
- [1]=>
- int(35999)
- [2]=>
- NULL
- [3]=>
- int(-500)
- [4]=>
- int(-9999999)
- [5]=>
- int(0)
- [6]=>
- int(0)
-}
Index: libmysequoia/test-suite/php5/mysqli/007.phpt
diff -u libmysequoia/test-suite/php5/mysqli/007.phpt:1.1
libmysequoia/test-suite/php5/mysqli/007.phpt:removed
--- libmysequoia/test-suite/php5/mysqli/007.phpt:1.1 Wed Feb 1 10:57:20 2006
+++ libmysequoia/test-suite/php5/mysqli/007.phpt Tue Mar 21 06:39:05 2006
@@ -1,54 +0,0 @@
---TEST--
-mysqli fetch short values
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
- include "connect.inc";
-
- /*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
-
- mysqli_select_db($link, "test");
- 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, "INSERT INTO test_bind_fetch VALUES
(-23,35999,NULL,-500,-9999999,+30,0)");
-
- $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
-
- $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
-
- var_dump($test);
-
- mysqli_stmt_close($stmt);
- mysqli_close($link);
-?>
---EXPECT--
-array(7) {
- [0]=>
- int(0)
- [1]=>
- int(35999)
- [2]=>
- NULL
- [3]=>
- int(-500)
- [4]=>
- int(-32768)
- [5]=>
- int(30)
- [6]=>
- int(0)
-}
Index: libmysequoia/test-suite/php5/mysqli/008.phpt
diff -u libmysequoia/test-suite/php5/mysqli/008.phpt:1.1
libmysequoia/test-suite/php5/mysqli/008.phpt:removed
--- libmysequoia/test-suite/php5/mysqli/008.phpt:1.1 Wed Feb 1 10:57:20 2006
+++ libmysequoia/test-suite/php5/mysqli/008.phpt Tue Mar 21 06:39:05 2006
@@ -1,54 +0,0 @@
---TEST--
-mysqli fetch tinyint values
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
- include "connect.inc";
-
- /*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
-
- mysqli_select_db($link, "test");
- 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, "INSERT INTO test_bind_fetch VALUES
(-23,300,0,-100,-127,+30,0)");
-
- $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
-
- $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
-
- var_dump($test);
-
- mysqli_stmt_close($stmt);
- mysqli_close($link);
-?>
---EXPECT--
-array(7) {
- [0]=>
- int(-23)
- [1]=>
- int(255)
- [2]=>
- int(0)
- [3]=>
- int(-100)
- [4]=>
- int(-127)
- [5]=>
- int(30)
- [6]=>
- int(0)
-}
Index: libmysequoia/test-suite/php5/mysqli/009.phpt
diff -u libmysequoia/test-suite/php5/mysqli/009.phpt:1.1
libmysequoia/test-suite/php5/mysqli/009.phpt:removed
--- libmysequoia/test-suite/php5/mysqli/009.phpt:1.1 Wed Feb 1 10:57:20 2006
+++ libmysequoia/test-suite/php5/mysqli/009.phpt Tue Mar 21 06:39:05 2006
@@ -1,79 +0,0 @@
---TEST--
-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');
-?>
---FILE--
-<?php
- include "connect.inc";
-
- /*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
-
- mysqli_select_db($link, "test");
- 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 bigint default 5,
- c2 bigint,
- c3 bigint not NULL,
- c4 bigint unsigned,
- c5 bigint unsigned,
- c6 bigint unsigned,
- c7 bigint unsigned)");
-
- mysqli_query($link, "INSERT INTO test_bind_fetch (c2,c3,c4,c5,c6,c7)
VALUES (-23,4.0,33333333333333,0,-333333333333,99.9)");
-
- $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
- mysqli_execute($stmt);
- $rc = mysqli_fetch($stmt);
-
- $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
-
- var_dump($test);
-
- mysqli_stmt_close($stmt);
-
- mysqli_query($link,"DROP TABLE IF EXISTS test_bind_fetch_uint");
- mysqli_query($link,"CREATE TABLE test_bind_fetch_uint(c1 integer
unsigned, c2 integer unsigned)");
-
- mysqli_query($link, "INSERT INTO test_bind_fetch_uint (c1,c2) VALUES
(20123456, 3123456789)");
-
- $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_fetch_uint");
- mysqli_bind_result($stmt, $c1, $c2);
- mysqli_execute($stmt);
- $rc = mysqli_fetch($stmt);
-
- echo $c1, "\n", $c2, "\n";
-
- mysqli_stmt_close($stmt);
-
-
- mysqli_close($link);
-?>
-
---EXPECT--
-array(7) {
- [0]=>
- int(5)
- [1]=>
- int(-23)
- [2]=>
- int(4)
- [3]=>
- string(14) "33333333333333"
- [4]=>
- int(0)
- [5]=>
- int(0)
- [6]=>
- int(100)
-}
-20123456
-3123456789
Index: libmysequoia/test-suite/php5/mysqli/010.phpt
diff -u libmysequoia/test-suite/php5/mysqli/010.phpt:1.1
libmysequoia/test-suite/php5/mysqli/010.phpt:removed
--- libmysequoia/test-suite/php5/mysqli/010.phpt:1.1 Wed Feb 1 10:57:20 2006
+++ libmysequoia/test-suite/php5/mysqli/010.phpt Tue Mar 21 06:39:05 2006
@@ -1,59 +0,0 @@
---TEST--
-mysqli fetch float values
---INI--
-precision=12
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
- include "connect.inc";
-
- /*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
-
- mysqli_select_db($link, "test");
- 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 float(3),
- c2 float,
- c3 float unsigned,
- c4 float,
- c5 float,
- c6 float,
- c7 float(10) unsigned)");
-
-
- 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_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
-
- $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7);
-
- var_dump($test);
-
- mysqli_stmt_close($stmt);
- mysqli_close($link);
-?>
---EXPECT--
-array(7) {
- [0]=>
- float(3.14159274101)
- [1]=>
- float(-9.99999997475E-7)
- [2]=>
- float(0)
- [3]=>
- float(999999995904)
- [4]=>
- float(0.564642488956)
- [5]=>
- float(1)
- [6]=>
- float(888888914608000)
-}
Index: libmysequoia/test-suite/php5/mysqli/011.phpt
diff -u libmysequoia/test-suite/php5/mysqli/011.phpt:1.1
libmysequoia/test-suite/php5/mysqli/011.phpt:removed
--- libmysequoia/test-suite/php5/mysqli/011.phpt:1.1 Wed Feb 1 10:57:20 2006
+++ libmysequoia/test-suite/php5/mysqli/011.phpt Tue Mar 21 06:39:05 2006
@@ -1,57 +0,0 @@
---TEST--
-mysqli fetch mixed values
---INI--
-precision=12
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
- include "connect.inc";
-
- /*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
-
- mysqli_select_db($link, "test");
-
- mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result");
-
- 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))");
-
- mysqli_query($link,"INSERT INTO test_bind_result
VALUES(19,2999,3999,4999999,
-
2345.6,5678.89563,
- 'foobar','mysql
rulez')");
- $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result");
- mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8);
- mysqli_execute($stmt);
- mysqli_fetch($stmt);
-
- $test = array($c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8);
-
- var_dump($test);
-
- mysqli_stmt_close($stmt);
- mysqli_close($link);
-?>
---EXPECT--
-array(8) {
- [0]=>
- int(19)
- [1]=>
- int(2999)
- [2]=>
- int(3999)
- [3]=>
- int(4999999)
- [4]=>
- float(2345.60009766)
- [5]=>
- float(5678.89563)
- [6]=>
- string(6) "foobar"
- [7]=>
- string(11) "mysql rulez"
-}
Index: libmysequoia/test-suite/php5/mysqli/012.phpt
diff -u libmysequoia/test-suite/php5/mysqli/012.phpt:1.1
libmysequoia/test-suite/php5/mysqli/012.phpt:removed
--- libmysequoia/test-suite/php5/mysqli/012.phpt:1.1 Wed Feb 1 10:57:20 2006
+++ libmysequoia/test-suite/php5/mysqli/012.phpt Tue Mar 21 06:39:05 2006
@@ -1,58 +0,0 @@
---TEST--
-mysqli fetch mixed values 2
---INI--
-precision=12
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---FILE--
-<?php
- include "connect.inc";
-
- /*** test mysqli_connect 127.0.0.1 ***/
- $link = mysqli_connect($host, $user, $passwd);
-
- mysqli_select_db($link, "test");
-
- mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result");
-
- mysqli_query($link,"CREATE