Msql-Mysql-modules

 view release on metacpan or  search on metacpan

ChangeLog  view on Meta::CPAN


	* lib/Msql/Statement.pm: Fixed use of Msql::TEXT_TYPE without
	  checking whether we are running Msql 1.

$Id: ChangeLog,v 1.12 1999/10/21 20:05:41 joe Exp $

DBD::mysql for DBI - Written by Jochen Wiedmann <joe@ispsoft.de>

97.09.27 V1.1812
          Added t/50commit.t to test suite.
	  Included <embed.h> in myMsql.h for redefining my_setenv().
	  Made AutoCommit, Commit and Rollback DBI conformant.
	  Fixed reconnect problems with Mysql: mysql_port was 0 on some
	  systems.
	  Added support of mysql_real_connect to myMsql.c.
	  Fixed Msql::errno returning a char*.
	  Added lib/Bundle::Mysql.pm.
          Fixed 'use Mysql' to 'require Mysql' in t/mysql2.t.
	
97.09.12 V1.1810
	  Fixed bug in dbd_st_FETCH_internal: newRV_noinc was used for

dbd/dbdimp.c  view on Meta::CPAN

 *  Purpose: Replacements for mysql_connect or msqlConnect
 *
 *  Input:   imp_dbh - database handle
 *
 *  Returns: TRUE for success, FALSE otherwise; you have to call
 *           do_error in the latter case.
 *
 *  Bugs:    The msql version needs to set the environment
 *           variable MSQL_TCP_PORT. There's absolutely no
 *           portable way of setting environment variables
 *           from within C: Neither setenv() nor putenv()
 *           are guaranteed to work. I have decided to use
 *           the internal perl functions setenv_getix()
 *           and my_setenv() instead, let's hope, this is safe.
 *
 *           Another problem was pointed out by Andreas:
 *           This isn't thread safe. We'll have fun with perl
 *           5.005 ... :-)
 *
 **************************************************************************/

int MyConnect(dbh_t *sock, char* unixSocket, char* host, char* port,
	      char* user, char* password, char* dbname, imp_dbh_t *imp_dbh) {
    int portNr;

dbd/dbdimp.c  view on Meta::CPAN

			client_flag);
        return mysql_real_connect(*sock, host, user, password, dbname,
				  portNr, unixSocket, client_flag) ?
	  TRUE : FALSE;
    }
#else
    {
        /*
	 *  Setting a port for msql's client is extremely ugly: We have
	 *  to set an environment variable. Even worse, we cannot trust
	 *  in setenv or putenv being present, thus we need to use
	 *  internal, not documented, perl functions. :-(
	 */
        char buffer[32];
	char* oldPort = NULL;

	if (imp_dbh) {
	    imp_dbh->has_transactions = FALSE;
	    DBIc_set(imp_dbh, DBIcf_AutoCommit, &sv_yes);
	}

	sprintf(buffer, "%d", portNr);
	if (portNr) {
	    oldPort = environ[setenv_getix("MSQL_TCP_PORT")];
	    if (oldPort) {
	        char* copy = (char*) malloc(strlen(oldPort)+1);
		if (!copy) {
		    return FALSE;
		}
		strcpy(copy, oldPort);
		oldPort = copy;
	    }
	    my_setenv("MSQL_TCP_PORT", buffer);
	}
	*sock = msqlConnect(host);
	if (oldPort) {
	    my_setenv("MSQL_TCP_PORT", oldPort);
	    if (oldPort) { free(oldPort); }
	}
	if (*sock != -1  &&  dbname  &&  MySelectDb(*sock, dbname)) {
	    MyClose(*sock);
	    *sock = -1;
	}
	return (*sock == -1) ? FALSE : TRUE;
    }
#endif
}



( run in 0.308 second using v1.01-cache-2.11-cpan-283623ac599 )