sqlrelay-discussion Mailing List for SQL Relay (Page 57)
Brought to you by:
mused
You can subscribe to this list here.
2005 |
Jan
|
Feb
(20) |
Mar
(27) |
Apr
(17) |
May
(32) |
Jun
(45) |
Jul
(49) |
Aug
(68) |
Sep
(44) |
Oct
(29) |
Nov
(64) |
Dec
(25) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(61) |
Feb
(22) |
Mar
(25) |
Apr
(31) |
May
(18) |
Jun
(28) |
Jul
(19) |
Aug
(16) |
Sep
(8) |
Oct
(17) |
Nov
(32) |
Dec
(4) |
2007 |
Jan
(20) |
Feb
(25) |
Mar
(5) |
Apr
(12) |
May
(11) |
Jun
(18) |
Jul
(16) |
Aug
(22) |
Sep
(37) |
Oct
(20) |
Nov
(11) |
Dec
(2) |
2008 |
Jan
(11) |
Feb
(33) |
Mar
(12) |
Apr
(18) |
May
(22) |
Jun
(31) |
Jul
(23) |
Aug
(6) |
Sep
|
Oct
(10) |
Nov
(22) |
Dec
|
2009 |
Jan
(12) |
Feb
(8) |
Mar
(11) |
Apr
(20) |
May
(18) |
Jun
(7) |
Jul
(27) |
Aug
(2) |
Sep
(10) |
Oct
(5) |
Nov
(2) |
Dec
(1) |
2010 |
Jan
(11) |
Feb
(18) |
Mar
(10) |
Apr
(28) |
May
(28) |
Jun
|
Jul
(27) |
Aug
(9) |
Sep
(21) |
Oct
(2) |
Nov
(2) |
Dec
(11) |
2011 |
Jan
|
Feb
(2) |
Mar
(4) |
Apr
(2) |
May
(2) |
Jun
(44) |
Jul
(9) |
Aug
(2) |
Sep
(12) |
Oct
(7) |
Nov
(11) |
Dec
(7) |
2012 |
Jan
(5) |
Feb
|
Mar
(9) |
Apr
(9) |
May
(12) |
Jun
|
Jul
(13) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
(10) |
2013 |
Jan
(21) |
Feb
(3) |
Mar
(4) |
Apr
|
May
(3) |
Jun
(2) |
Jul
(3) |
Aug
(3) |
Sep
(3) |
Oct
|
Nov
|
Dec
(4) |
2014 |
Jan
(7) |
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
(4) |
Aug
(2) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ken M. <mc...@ar...> - 2005-08-08 04:28:45
|
I'm just now experimenting with SQL Relay for the first time. The FreeBSD port is out of date, so I'm reworking it (I'll send in a patch when it's working properly), but I'm unclear as to whether I'm wasting my time or not. As the subject line implies, I'm running * Platform: FreeBSD 5.4-STABLE * Database: PostgreSQL 8.0.3 * Webserver: Apache 2.0.54 + PHP 5.0.4 I'm hoping to get this running well with SQL Relay 0.36.4; I just can't tell if this latest version supports all this software or not. There's a line in src/api/php/README that says, "Module was originally written with PHP-4.0.0," but this doesn't let me know whether it works with newer versions or not. (Certainly src/api/phppeardb/sqlrelay.php says right up front that it's PHP 4, so that's out.) So. Anyone doing this? Having any problems with it? Or do I just need to wait until a future update of SQL Relay? Thanks very much. ---Ken |
From: David M. <dav...@fi...> - 2005-08-08 03:34:48
|
Ok, fixed it. If you're willing to compile from source, here's the fix: edit src/api/mysql/mysql.C and change: unsigned long *mysql_fetch_lengths(MYSQL_RES *result) { return (unsigned long *)result->sqlrcur-> getRowLengths(result->currentrow); } to: unsigned long *mysql_fetch_lengths(MYSQL_RES *result) { return (unsigned long *)result->sqlrcur-> getRowLengths(result->previousrow); } That's the fix. Dave dav...@fi... On Sun, 2005-08-07 at 21:57 -0400, David Muse wrote: > Yeah, looks like a bug. I just reproduced it. I'll track it down and > get a fix out. > > David Muse > dav...@fi... > > On Fri, 2005-08-05 at 16:00 -0700, Guy Berliner wrote: > > I'm doing "export LD_PRELOAD=/usr/lib/libmysql41sqlrelay.so", with mysql > > 4.1.12 on Fedora Core release 3.92 (Pre-FC4). I can connect to sqlrelay > > on another host on port 9000, read a bunch of rows out of any table > > successfully, but immediately after my first query, mysql segfaults. In > > my sqlr-connection logs I see, corresponding to this segfault, an error > > as follows: > > > > 08/05/2005 15:49:48 PDT connection [12233] : done returning result set data > > 08/05/2005 15:49:48 PDT connection [12233] : getting command... > > 08/05/2005 15:49:49 PDT connection [12233] : getting command failed: > > client sent bad command > > 08/05/2005 15:49:49 PDT connection [12233] : endingsession... > > 08/05/2005 15:49:49 PDT connection [12233] : aborting all busy cursors... > > 08/05/2005 15:49:49 PDT connection [12233] : 0 > > 08/05/2005 15:49:49 PDT connection [12233] : done aborting all busy cursors > > 08/05/2005 15:49:49 PDT connection [12233] : resetting autocommit > > behavior... > > > > I'd like to figure out how to make multiple queries during a single > > mysql session, without any unsightly segfaults. Thanks in advance for > > any help! > > > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > |
From: David M. <dav...@fi...> - 2005-08-08 01:53:56
|
Yeah, looks like a bug. I just reproduced it. I'll track it down and get a fix out. David Muse dav...@fi... On Fri, 2005-08-05 at 16:00 -0700, Guy Berliner wrote: > I'm doing "export LD_PRELOAD=/usr/lib/libmysql41sqlrelay.so", with mysql > 4.1.12 on Fedora Core release 3.92 (Pre-FC4). I can connect to sqlrelay > on another host on port 9000, read a bunch of rows out of any table > successfully, but immediately after my first query, mysql segfaults. In > my sqlr-connection logs I see, corresponding to this segfault, an error > as follows: > > 08/05/2005 15:49:48 PDT connection [12233] : done returning result set data > 08/05/2005 15:49:48 PDT connection [12233] : getting command... > 08/05/2005 15:49:49 PDT connection [12233] : getting command failed: > client sent bad command > 08/05/2005 15:49:49 PDT connection [12233] : endingsession... > 08/05/2005 15:49:49 PDT connection [12233] : aborting all busy cursors... > 08/05/2005 15:49:49 PDT connection [12233] : 0 > 08/05/2005 15:49:49 PDT connection [12233] : done aborting all busy cursors > 08/05/2005 15:49:49 PDT connection [12233] : resetting autocommit > behavior... > > I'd like to figure out how to make multiple queries during a single > mysql session, without any unsightly segfaults. Thanks in advance for > any help! > |
From: David M. <dav...@fi...> - 2005-08-08 00:53:31
|
Are the permissions on the socket and the /tmp directory such that php can access the socket? Also, FC4 comes with selinux enabled by default, it's possible that the security settings for apache are too restrictive. Are you using selinux? I have had problems with selinux restricting so many applications in so many funny ways that I have had to just turn it off until I can study up on it and figure out how to get things working with it. By the way, if someone could point me in the direction of a good selinux tutorial, I'd appreciate it. David Muse dav...@fi... On Sun, 2005-08-07 at 14:43 +0200, vieonet forums wrote: > Hello > > I installed fedora core 4, and intall sqlrelay package FC4. > > I configure, and start sqlrelay. > > It started well, creating 3 connection to postgres database. > > I install the php extension, which is well recocgnised in the php.ini. > > But when I try to connect to the database, I got hte following message: > "could not connect listener". > > I check in my tmp directory and the socket is well here. > > please help > > regards > > david > > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > |
From: vieonet f. <df...@vi...> - 2005-08-07 12:43:41
|
Hello I installed fedora core 4, and intall sqlrelay package FC4. I configure, and start sqlrelay. It started well, creating 3 connection to postgres database. I install the php extension, which is well recocgnised in the php.ini. But when I try to connect to the database, I got hte following message: "could not connect listener". I check in my tmp directory and the socket is well here. please help regards david |
From: Guy B. <gbe...@te...> - 2005-08-05 23:00:35
|
I'm doing "export LD_PRELOAD=/usr/lib/libmysql41sqlrelay.so", with mysql 4.1.12 on Fedora Core release 3.92 (Pre-FC4). I can connect to sqlrelay on another host on port 9000, read a bunch of rows out of any table successfully, but immediately after my first query, mysql segfaults. In my sqlr-connection logs I see, corresponding to this segfault, an error as follows: 08/05/2005 15:49:48 PDT connection [12233] : done returning result set data 08/05/2005 15:49:48 PDT connection [12233] : getting command... 08/05/2005 15:49:49 PDT connection [12233] : getting command failed: client sent bad command 08/05/2005 15:49:49 PDT connection [12233] : endingsession... 08/05/2005 15:49:49 PDT connection [12233] : aborting all busy cursors... 08/05/2005 15:49:49 PDT connection [12233] : 0 08/05/2005 15:49:49 PDT connection [12233] : done aborting all busy cursors 08/05/2005 15:49:49 PDT connection [12233] : resetting autocommit behavior... I'd like to figure out how to make multiple queries during a single mysql session, without any unsightly segfaults. Thanks in advance for any help! |
From: David M. <dav...@fi...> - 2005-08-05 02:29:51
|
No, I didn't get that one implemented. I'll have to update the docs and get it implemented in 0.37. Dave dav...@fi... On Wed, 2005-07-27 at 15:21 -0700, Chris Falk wrote: > Hi David, > > > > The online documentation mentions that there “should be an idle > timeout feature in 0.36 …” Was such a feature ever implemented? I > cannot find any mention of it in the Changelog. > > > > Thanks! > > Chris > > > > Chris Falk > Senior Software Engineer > siberra > DIGITAL MEDIA SYSTEMS > Tel: 604-696-3224 > Fax: 604-696-3201 > ch...@si... > www.siberra.com > > > > |
From: David M. <dav...@fi...> - 2005-08-05 02:28:14
|
Sorry, it's been a while. I couldn't find anything in their documentation about the different threads/processes, except that there's a "one-thread" option, so I assume that by default it runs in multi-threaded mode, but I couldn't find any information about how many threads it uses or what they do. Sorry :) Dave dav...@fi... On Wed, 2005-07-27 at 22:17 -0400, David Muse wrote: > Honestly, I'm not sure. When I start up mysql, I get a single mysqld > process, and starting SQL Relay (which opens 3 connections) doesn't > cause any more mysqld processes to start. I assumed they're > multiplexing clients through a single thread, but I'm really not sure > how it works. The 10 mysqld's you're seeing might be threads that > aren't related to incoming clients at all, like a logger thread, a > thread connected to each database file, a listener thread, etc. There > may be configuration options that control the number of threads or > processes that start up. I really don't know. I'll see if the mysql > online documentation has any info on the subject. > > David Muse > dav...@fi... > > On Tue, 2005-07-26 at 17:48 -0400, Tony Burger wrote: > > I'm running sqlrelay 0.36.4 with MySQL 4.1 on a tinysofa.org linux 2.6 > > kernel and connect via Python scripts. Everything is setup OK and runs > > fine. When I start the MySQL server, it appears to start up 10 sessions > > (via ps -ef). I see one of these lines: > > root 982 1 0 16:33 pts/0 00:00:00 /bin/sh > > /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data > > --pid-file=/usr/local/ > > > > and 10 of these lines: > > mysql 1014 982 0 16:34 pts/0 00:00:00 /usr/local/mysql/libexec/mysqld > > --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --us > > > > When I fire up sqlrelay, I get an additional (x) number of the second > > lines above based on the intial number of connections I set in the > > sqlrelay.conf file. Is there a way to make sqlrelay use one of the > > existing sessions already started? Or can I alter the MySQL my.cnf file > > to not start as many connections? Anyone know how this works? Thanks! > > > > > > ------------------------------------------------------- > > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > > from IBM. Find simple to follow Roadmaps, straightforward articles, > > informative Webcasts and more! Get everything you need to get up to > > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > > _______________________________________________ > > Sqlrelay-discussion mailing list > > Sql...@li... > > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > > > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO September > 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > |
From: David M. <dav...@fi...> - 2005-08-05 02:14:40
|
Well, I didn't get to look at it that night. Sorry about that :) I figured it out. getField() works but fields returned from getRow() don't. I fixed it though. If you replace src/api/python/CSQLRelay.C with the attached file and rebuild/reinstall, it will work. Dave On Thu, 2005-07-28 at 11:02 -0400, Firstworks/4access wrote: > Sorry, I forgot to mention. I tried cPickle.dumps(sdata) and > cPickle.dumps(sdata,2) and both worked for me. I wonder if there's a > bug in 0.36 that's causing the error. I'll give it a try tonight and > let you know what I find. > > Dave > > On Thu, 2005-07-28 at 09:28 +0100, Ville Silventoinen wrote: > > Hi Dave, > > > > thank you very much for putting your time into this. As I tried to explain > > in my earlier mail (I'm not very good in explaining things!), the problem > > happens when I use cPickle.dumps to generate a binary string, not a text > > string. You get a binary string by specifying a second parameter '2' > > (according to my source, Python Cookbook, 2nd ed): > > > > bdata=cPickle.dumps(sdata, 2) > > > > When I run your test script, it works, because cPickle.dumps(sdata) > > generates a text string. But when I do the above change, I get an error: > > > > {'spam': {'eggs': 'spamspam', 'answers': {1: '', 2: 'foo', 3: 'bar'}}} > > Traceback (most recent call last): > > File "./testsqlr.py", line 32, in ? > > mydata=cPickle.loads(fields[0]) > > EOFError > > > > It's not really necessary to use a binary string in my case, so I wouldn't > > give this problem a very high priority. The Python Cookbook states that > > using binary strings is "faster and takes up less space". > > > > I haven't had time to try your suggestion about using getField() and > > getFieldLength() for blobs. I'll try it in the next few days. > > > > My SQLRelay is version 0.36 with rudiments 0.28.2. > > > > Thanks again! > > > > Ville > > > > > > On Wed, 27 Jul 2005, David Muse wrote: > > > > > Ville, > > > > > > I have run some tests with my development version and the following > > > script works: > > > > > > #! /usr/bin/env python > > > > > > # Copyright (c) 2001 David Muse > > > # See the file COPYING for more information. > > > > > > from SQLRelay import PySQLRClient > > > import sys > > > import string > > > import cPickle > > > > > > con=PySQLRClient.sqlrconnection("localhost",8009,"/tmp/oracle8test.socket","oracle8test","oracle8test") > > > #con.debugOn() > > > cur=PySQLRClient.sqlrcursor(con) > > > > > > cur.sendQuery("drop table testtable"); > > > cur.sendQuery("create table testtable (col1 blob)") > > > > > > cur.prepareQuery("insert into testtable values(:val1)"); > > > sdata={'spam': {'eggs': 'spamspam', 'answers': {1:'', 2:'foo', > > > 3:'bar'}}} > > > bdata=cPickle.dumps(sdata) > > > blen=len(bdata) > > > cur.inputBindBlob('val1',bdata,blen) > > > cur.executeQuery() > > > > > > cur.sendQuery("select * from testtable"); > > > mydata=cPickle.loads(cur.getField(0,0)) > > > print mydata > > > > > > cur.sendQuery("select * from testtable"); > > > fields=cur.getRow(0) > > > mydata=cPickle.loads(fields[0]) > > > print mydata > > > > > > cur.sendQuery("drop table testtable"); > > > > > > > > > It prints out a tuple identical to the one sdata is set to. See if it > > > doesn't work for you too. If not, then there may be a bug specific to > > > the version of SQL Relay you're using. What version is that, by the > > > way? > > > > > > Dave > > > > > > > > > On Thu, 2005-07-21 at 16:10 +0100, Ville Silventoinen wrote: > > >> Hi Dave, > > >> > > >> Python len seems to be working correctly with pickled data. > > >> > > >> I did find out that cPickle.dumps(sdata) works ok. This generates string > > >> representation of the pickled data, which doesn't contain a \0 character. > > >> (I had a typo in my earlier test, the create procedure used string data, > > >> the modify procedure used binary, which is why I thought neither dumps > > >> worked.) > > >> > > >> If I use the HIGHEST_PROTOCOL with dumps, it generates binary data. This > > >> seems to have a problem with inputBindBlob(), unless I'm still doing > > >> something wrong. So if I am right, you should be able to recreate the > > >> problem with something like this: > > >> > > >> sdata={'spam': {'eggs': 'spamspam', 'answers': {1:'', 2:'foo', 3:'bar'}}} > > >> ... > > >> bdata = cPickle.dumps(sdata, 2) # uses HIGHEST_PROTOCOL > > >> blen = len(bdata) > > >> cur.inputBindBlob('colname', bdata, blen) > > >> ... > > >> # read the data by using normal select > > >> ... > > >> mydata = cPickle.loads(fields[0]) > > >> # this throws EOFError (at least in my case) > > >> > > >> I think '' generates \x00 or \x0, which becomes EOF with inputBindBlob. > > >> Perhaps it encodes \x00 as \0? Or maybe the problem is in the select? > > >> Is it ok to use normal select to read blobs? > > >> > > >> Thanks, > > >> Ville > > >> > > >> > > >> On Thu, 21 Jul 2005, Firstworks/4access wrote: > > >> > > >>> Ville, > > >>> > > >>> I was actually looking at that last night. I'm believe you're on track. > > >>> inputBind() does a strlen() of the string to decide how many characters > > >>> to store in the database. strlen() interprets \0's as end-of-string > > >>> markers, so only part of the data gets stored in the blob. Then, later > > >>> when you fetch and unpickle it, only part of it gets unpickled. I > > >>> believe the solution is to use inputBindBlob() or inputBindClob() rather > > >>> than inputBind() to store the pickled data. inputBindBlob() and > > >>> inputBindClob() take a length parameter and ignore \0's. > > >>> > > >>> Give it a try and let me know whether it works or not. > > >>> > > >>> Dave > > >>> dav...@fi... > > >>> > > >>> On Thu, 2005-07-21 at 12:31 +0100, Ville Silventoinen wrote: > > >>>> Hi, > > >>>> > > >>>> I'm using PySQLRClient from sqlrelay-0.36 (with rudiments-0.28.2) > > >>>> to store blobs in Oracle 9.2.0 database. > > >>>> > > >>>> I'm not sure if this has been fixed in the recent sqlrelay release, > > >>>> but I'm experiencing problems when I store a Python data structure > > >>>> (dictionary object) to a blob using Pythons cPickle module. Everything > > >>>> works great until one of the values in the pickled object is an empty > > >>>> string (''). After that cPickle.load fails to read the data, it raises > > >>>> EOFError exception. So I wonder if PySQLRClient interprets the pickled > > >>>> '' as an end-of-file character? > > >>>> > > >>>> If I try loading/saving similar data structure to a file, it works ok. > > >>>> > > >>>> Thanks for any advice, > > >>>> > > >>>> Ville > > >>>> > > >>>> > > >>>> > > >>>> > > >>>> ------------------------------------------------------- > > >>>> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > > >>>> from IBM. Find simple to follow Roadmaps, straightforward articles, > > >>>> informative Webcasts and more! Get everything you need to get up to > > >>>> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > > >>>> _______________________________________________ > > >>>> Sqlrelay-discussion mailing list > > >>>> Sql...@li... > > >>>> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > > >>>> > > >>> > > >>> > > >>> > > >>> ------------------------------------------------------- > > >>> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > > >>> from IBM. Find simple to follow Roadmaps, straightforward articles, > > >>> informative Webcasts and more! Get everything you need to get up to > > >>> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > > >>> _______________________________________________ > > >>> Sqlrelay-discussion mailing list > > >>> Sql...@li... > > >>> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > > >>> > > >> > > >> > > >> ------------------------------------------------------- > > >> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > > >> from IBM. Find simple to follow Roadmaps, straightforward articles, > > >> informative Webcasts and more! Get everything you need to get up to > > >> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > > >> _______________________________________________ > > >> Sqlrelay-discussion mailing list > > >> Sql...@li... > > >> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > > >> > > > > > > > > > > > > ------------------------------------------------------- > > > SF.Net email is Sponsored by the Better Software Conference & EXPO September > > > 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > > > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > > > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > > > _______________________________________________ > > > Sqlrelay-discussion mailing list > > > Sql...@li... > > > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > > > > > > > > > ------------------------------------------------------- > > SF.Net email is Sponsored by the Better Software Conference & EXPO September > > 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > > _______________________________________________ > > Sqlrelay-discussion mailing list > > Sql...@li... > > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > > > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO September > 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > |
From: Ionut C. <ion...@av...> - 2005-08-04 21:26:23
|
Oracle CLOBS are meant to be fetched using output binds, so what you're experiencing is not an SQL Relay issue, but an Oracle "feature". If you didn't experience this before, it might be because DBI probably does its part of abstractization, parsing the query and rewriting it to fetch the CLOBS separately, then transparently delivering the full result set to the client app. This is what one would expect when running such a query against a DBMS that doesn't support CLOBS (or supports some sort of an unlimited TEXT data type) -- postgres, mysql etc., but no, not Oracle. If I'm right and DBI performs such query rewrites, then it should be able to do that when using the Sql Relay driver too, so it's an implementation that has to be done within this driver, to resemble the original OCI driver. Ionut ----- Original Message ----- From: "Chris Fuhrman" <cfu...@gm...> Sent: Thursday, August 04, 2005 8:53 PM Subject: [Sqlrelay-discussion] Getting SQLRelay to play happily with Oracle 8i, CLOBs, and Perl DBI Howdy, Trying to get SQLrelay to work with an Oracle 8i (8.1.7) database and am having an issue pulling Oracle CLOBs. Here's the environment Specifics: Data Base Server: Solaris 8 x86 running Oracle 8i (8.1.7) SQL-Relay Server: Redhat Linux 9 running SQL-Relay 0.36.4 Application Server: Solaris 9 x86 w/ perl 5.8.0 I'm trying to pull from this table: Name Null? Type ----------------------------------------- -------- ---------------------------- SES_ID NOT NULL VARCHAR2(64) USR_ID NUMBER(12) CLI_ID NUMBER(12) AUTH_LEVEL NUMBER(12) IP_ADDR VARCHAR2(32) DATA CLOB DATA_SIZE NUMBER(12) STATUS NOT NULL NUMBER(2) CTIME NOT NULL DATE MTIME NOT NULL DATE SECURITY NUMBER(20) As you may notice, the DATA column is a CLOB. I've found SQL-Relay's debugging feature and tried to see what was going on: 08/04/2005 13:43:39 EDT connection [6005] : fetching 100 rows... 08/04/2005 13:43:39 EDT connection [6005] : "81","2004/11/09 00:00:00","^E^F^C And here is the SQL that was run: SELECT auth_level, cli_id, TO_CHAR( ctime, 'YYYY/MM/DD HH24:MI:SS' ), data, ip_addr, TO_CHAR( mtime, 'YYYY/MM/DD HH24:MI:SS' ), security, ses_id, data_size, status, usr_id FROM ucs3_user.sess WHERE status IN ( ?, ? ) AND ses_id = ? Bind values: [0] 0 [1] 1 [2] 724a33a8a67d7a7cdd0951995cb1b5bc1792a2b0 Yet I seem to be getting garbage back. If anyone has any experience getting SQL-relay to properly digest Oracle CLOBs or if you require additional information, let me know. Cheers! -- Chris Fuhrman cfu...@gm... ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Sqlrelay-discussion mailing list Sql...@li... https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion |
From: Chris F. <cfu...@gm...> - 2005-08-04 17:53:17
|
Howdy, Trying to get SQLrelay to work with an Oracle 8i (8.1.7) database and am having an issue pulling Oracle CLOBs. Here's the environment Specifics: Data Base Server: Solaris 8 x86 running Oracle 8i (8.1.7) SQL-Relay Server: Redhat Linux 9 running SQL-Relay 0.36.4 Application Server: Solaris 9 x86 w/ perl 5.8.0 I'm trying to pull from this table: Name Null? Type ----------------------------------------- -------- -----------------------= ----- SES_ID NOT NULL VARCHAR2(64) USR_ID NUMBER(12) CLI_ID NUMBER(12) AUTH_LEVEL NUMBER(12) IP_ADDR VARCHAR2(32) DATA CLOB DATA_SIZE NUMBER(12) STATUS NOT NULL NUMBER(2) CTIME NOT NULL DATE MTIME NOT NULL DATE SECURITY NUMBER(20) As you may notice, the DATA column is a CLOB. I've found SQL-Relay's debugging feature and tried to see what was going on= : 08/04/2005 13:43:39 EDT connection [6005] : fetching 100 rows..= . 08/04/2005 13:43:39 EDT connection [6005] : =20 "81","2004/11/09 00:00:00","^E^F^C And here is the SQL that was run: SELECT auth_level, cli_id, TO_CHAR( ctime, 'YYYY/MM/DD HH24:MI:SS' ), data, ip_addr, TO_CHAR( mtime, 'YYYY/MM/DD HH24:MI:SS' ), security, ses_id, data_size, status, usr_id FROM ucs3_user.sess WHERE status IN ( ?, ? ) AND ses_id =3D ? Bind values: [0] 0 [1] 1 [2] 724a33a8a67d7a7cdd0951995cb1b5bc1792a2b0 Yet I seem to be getting garbage back. If anyone has any experience getting SQL-relay to properly digest Oracle CLOBs or if you require additional information, let me know. Cheers! --=20 Chris Fuhrman cfu...@gm... |
From: Maciej W. <mac...@co...> - 2005-08-02 09:48:58
|
I'am testing Zope with SQLRelay and I've found in error_log that I'm geting error: -------------------------------------------- Traceback (most recent call last): File "/opt/Zope/2.8.0/lib/python/transaction/_transaction.py", line 488, in abort rm.abort(self) File "/opt/Zope/2.8.0/lib/python/transaction/_transaction.py", line 561, in abort self.manager.abort(o, txn) File "/opt/Zope/2.8.0/lib/python/Shared/DC/ZRDB/TM.py", line 64, in abort try: self._abort() File "/opt/Zope/instancje/ckk_testa/Products/ZSQLRelayDA/db.py", line 53, in _abort self.con.rollback() File "/opt/Zope/instancje/2.8/cr_kw_eksp/Products/ZSQLRelayDA/SQLRelay/PySQLRDB.py", line 79, in rollback return CSQLRelay.rollback(self.connection) TypeError: an integer is required -------------------------------------------- I've checked this and self.connection is sometimes None. I've changed PySQLRDB.py: in class SQLRConnection: from: def rollback(self): self.rowcount=0 return CSQLRelay.rollback(self.connection) to: def rollback(self): self.rowcount=0 if self.connection is not None: return CSQLRelay.rollback(self.connection) I see no more errors, Zope returns HTTP headers 200 so I think users doesn't get any errors too. But I'm not sure if it will not cause any side effects. Similairly commit method doesn't do any self.connection checking. Is this a good change? -- Maciej Wisniowski |
From: linuxman <lin...@bl...> - 2005-07-28 17:07:07
|
please check debug output, is there any message that contained "failed "? grep "failed" * maybe helpful. I think you have not authenticated to sqlrelay or database backend. -----????----- ???: sql...@li... [mailto:sql...@li...] ?? Ben Gribaudo ????: 2005?7?28? 22:46 ???: sql...@li... ??: [Sqlrelay-discussion] Re: Debian 3.1 Install -- Socket Problem Hi David, Thank you for the pointer. Changing permissions on /tmp resolved that error. Now, I can open sqlrsh and enter a query. However, it hangs after I press <enter>. I don't get a results set or an error message--just a blank line: | 0> select * from tablename; | Any ideas? Ben ======================= From: David Muse <david@fi...> Re: Debian 3.1 Install -- Socket Problem 2005-07-26 18:03 What are the runasuser and runasgroup settings set to for the instance you"re trying to start? If /tmp has 755 permissions, then unless they"re both set to the owner of the /tmp, then you won"t be able to create a socket there. Also, is this a custom kernel build? Is it possible that unix socket support was accidentally removed from the kernel? David Muse david.muse@fi... On Tue, 2005-07-26 at 09:47 -0500, Ben Gribaudo wrote: > Hello, > > I am attempting to get SQLRelay running on a new Debian 3.1 box. Would any > of you be able to point me in the right direction to get sqlr-listener > listening on sqlrelay.socket? I"m getting "Could not listen on unix > socket: /tmp/sqlrelay.socket". > > I"ve googled but haven"t come up with anything on this. Permissions on > /tmp are 755 and I am attempting to run /etc/init.d/sqlrelay start as root. > > Full error message and version information below. > > Thank you, > Ben [snip] ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Sqlrelay-discussion mailing list Sql...@li... https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion |
From: Firstworks/4access <dav...@fi...> - 2005-07-28 14:58:48
|
Sorry, I forgot to mention. I tried cPickle.dumps(sdata) and cPickle.dumps(sdata,2) and both worked for me. I wonder if there's a bug in 0.36 that's causing the error. I'll give it a try tonight and let you know what I find. Dave On Thu, 2005-07-28 at 09:28 +0100, Ville Silventoinen wrote: > Hi Dave, > > thank you very much for putting your time into this. As I tried to explain > in my earlier mail (I'm not very good in explaining things!), the problem > happens when I use cPickle.dumps to generate a binary string, not a text > string. You get a binary string by specifying a second parameter '2' > (according to my source, Python Cookbook, 2nd ed): > > bdata=cPickle.dumps(sdata, 2) > > When I run your test script, it works, because cPickle.dumps(sdata) > generates a text string. But when I do the above change, I get an error: > > {'spam': {'eggs': 'spamspam', 'answers': {1: '', 2: 'foo', 3: 'bar'}}} > Traceback (most recent call last): > File "./testsqlr.py", line 32, in ? > mydata=cPickle.loads(fields[0]) > EOFError > > It's not really necessary to use a binary string in my case, so I wouldn't > give this problem a very high priority. The Python Cookbook states that > using binary strings is "faster and takes up less space". > > I haven't had time to try your suggestion about using getField() and > getFieldLength() for blobs. I'll try it in the next few days. > > My SQLRelay is version 0.36 with rudiments 0.28.2. > > Thanks again! > > Ville > > > On Wed, 27 Jul 2005, David Muse wrote: > > > Ville, > > > > I have run some tests with my development version and the following > > script works: > > > > #! /usr/bin/env python > > > > # Copyright (c) 2001 David Muse > > # See the file COPYING for more information. > > > > from SQLRelay import PySQLRClient > > import sys > > import string > > import cPickle > > > > con=PySQLRClient.sqlrconnection("localhost",8009,"/tmp/oracle8test.socket","oracle8test","oracle8test") > > #con.debugOn() > > cur=PySQLRClient.sqlrcursor(con) > > > > cur.sendQuery("drop table testtable"); > > cur.sendQuery("create table testtable (col1 blob)") > > > > cur.prepareQuery("insert into testtable values(:val1)"); > > sdata={'spam': {'eggs': 'spamspam', 'answers': {1:'', 2:'foo', > > 3:'bar'}}} > > bdata=cPickle.dumps(sdata) > > blen=len(bdata) > > cur.inputBindBlob('val1',bdata,blen) > > cur.executeQuery() > > > > cur.sendQuery("select * from testtable"); > > mydata=cPickle.loads(cur.getField(0,0)) > > print mydata > > > > cur.sendQuery("select * from testtable"); > > fields=cur.getRow(0) > > mydata=cPickle.loads(fields[0]) > > print mydata > > > > cur.sendQuery("drop table testtable"); > > > > > > It prints out a tuple identical to the one sdata is set to. See if it > > doesn't work for you too. If not, then there may be a bug specific to > > the version of SQL Relay you're using. What version is that, by the > > way? > > > > Dave > > > > > > On Thu, 2005-07-21 at 16:10 +0100, Ville Silventoinen wrote: > >> Hi Dave, > >> > >> Python len seems to be working correctly with pickled data. > >> > >> I did find out that cPickle.dumps(sdata) works ok. This generates string > >> representation of the pickled data, which doesn't contain a \0 character. > >> (I had a typo in my earlier test, the create procedure used string data, > >> the modify procedure used binary, which is why I thought neither dumps > >> worked.) > >> > >> If I use the HIGHEST_PROTOCOL with dumps, it generates binary data. This > >> seems to have a problem with inputBindBlob(), unless I'm still doing > >> something wrong. So if I am right, you should be able to recreate the > >> problem with something like this: > >> > >> sdata={'spam': {'eggs': 'spamspam', 'answers': {1:'', 2:'foo', 3:'bar'}}} > >> ... > >> bdata = cPickle.dumps(sdata, 2) # uses HIGHEST_PROTOCOL > >> blen = len(bdata) > >> cur.inputBindBlob('colname', bdata, blen) > >> ... > >> # read the data by using normal select > >> ... > >> mydata = cPickle.loads(fields[0]) > >> # this throws EOFError (at least in my case) > >> > >> I think '' generates \x00 or \x0, which becomes EOF with inputBindBlob. > >> Perhaps it encodes \x00 as \0? Or maybe the problem is in the select? > >> Is it ok to use normal select to read blobs? > >> > >> Thanks, > >> Ville > >> > >> > >> On Thu, 21 Jul 2005, Firstworks/4access wrote: > >> > >>> Ville, > >>> > >>> I was actually looking at that last night. I'm believe you're on track. > >>> inputBind() does a strlen() of the string to decide how many characters > >>> to store in the database. strlen() interprets \0's as end-of-string > >>> markers, so only part of the data gets stored in the blob. Then, later > >>> when you fetch and unpickle it, only part of it gets unpickled. I > >>> believe the solution is to use inputBindBlob() or inputBindClob() rather > >>> than inputBind() to store the pickled data. inputBindBlob() and > >>> inputBindClob() take a length parameter and ignore \0's. > >>> > >>> Give it a try and let me know whether it works or not. > >>> > >>> Dave > >>> dav...@fi... > >>> > >>> On Thu, 2005-07-21 at 12:31 +0100, Ville Silventoinen wrote: > >>>> Hi, > >>>> > >>>> I'm using PySQLRClient from sqlrelay-0.36 (with rudiments-0.28.2) > >>>> to store blobs in Oracle 9.2.0 database. > >>>> > >>>> I'm not sure if this has been fixed in the recent sqlrelay release, > >>>> but I'm experiencing problems when I store a Python data structure > >>>> (dictionary object) to a blob using Pythons cPickle module. Everything > >>>> works great until one of the values in the pickled object is an empty > >>>> string (''). After that cPickle.load fails to read the data, it raises > >>>> EOFError exception. So I wonder if PySQLRClient interprets the pickled > >>>> '' as an end-of-file character? > >>>> > >>>> If I try loading/saving similar data structure to a file, it works ok. > >>>> > >>>> Thanks for any advice, > >>>> > >>>> Ville > >>>> > >>>> > >>>> > >>>> > >>>> ------------------------------------------------------- > >>>> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > >>>> from IBM. Find simple to follow Roadmaps, straightforward articles, > >>>> informative Webcasts and more! Get everything you need to get up to > >>>> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > >>>> _______________________________________________ > >>>> Sqlrelay-discussion mailing list > >>>> Sql...@li... > >>>> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > >>>> > >>> > >>> > >>> > >>> ------------------------------------------------------- > >>> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > >>> from IBM. Find simple to follow Roadmaps, straightforward articles, > >>> informative Webcasts and more! Get everything you need to get up to > >>> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > >>> _______________________________________________ > >>> Sqlrelay-discussion mailing list > >>> Sql...@li... > >>> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > >>> > >> > >> > >> ------------------------------------------------------- > >> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > >> from IBM. Find simple to follow Roadmaps, straightforward articles, > >> informative Webcasts and more! Get everything you need to get up to > >> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > >> _______________________________________________ > >> Sqlrelay-discussion mailing list > >> Sql...@li... > >> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > >> > > > > > > > > ------------------------------------------------------- > > SF.Net email is Sponsored by the Better Software Conference & EXPO September > > 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > > _______________________________________________ > > Sqlrelay-discussion mailing list > > Sql...@li... > > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO September > 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > |
From: Ben G. <me...@be...> - 2005-07-28 14:47:18
|
Hi David, Thank you for the pointer. Changing permissions on /tmp resolved that error. Now, I can open sqlrsh and enter a query. However, it hangs after I press <enter>. I don't get a results set or an error message--just a blank line: | 0> select * from tablename; | Any ideas? Ben ======================= From: David Muse <david@fi...> Re: Debian 3.1 Install -- Socket Problem 2005-07-26 18:03 What are the runasuser and runasgroup settings set to for the instance you"re trying to start? If /tmp has 755 permissions, then unless they"re both set to the owner of the /tmp, then you won"t be able to create a socket there. Also, is this a custom kernel build? Is it possible that unix socket support was accidentally removed from the kernel? David Muse david.muse@fi... On Tue, 2005-07-26 at 09:47 -0500, Ben Gribaudo wrote: > Hello, > > I am attempting to get SQLRelay running on a new Debian 3.1 box. Would any > of you be able to point me in the right direction to get sqlr-listener > listening on sqlrelay.socket? I"m getting "Could not listen on unix > socket: /tmp/sqlrelay.socket". > > I"ve googled but haven"t come up with anything on this. Permissions on > /tmp are 755 and I am attempting to run /etc/init.d/sqlrelay start as root. > > Full error message and version information below. > > Thank you, > Ben [snip] |
From: Ville S. <vs...@eb...> - 2005-07-28 08:29:37
|
Hi Dave, thank you very much for putting your time into this. As I tried to explain in my earlier mail (I'm not very good in explaining things!), the problem happens when I use cPickle.dumps to generate a binary string, not a text string. You get a binary string by specifying a second parameter '2' (according to my source, Python Cookbook, 2nd ed): bdata=cPickle.dumps(sdata, 2) When I run your test script, it works, because cPickle.dumps(sdata) generates a text string. But when I do the above change, I get an error: {'spam': {'eggs': 'spamspam', 'answers': {1: '', 2: 'foo', 3: 'bar'}}} Traceback (most recent call last): File "./testsqlr.py", line 32, in ? mydata=cPickle.loads(fields[0]) EOFError It's not really necessary to use a binary string in my case, so I wouldn't give this problem a very high priority. The Python Cookbook states that using binary strings is "faster and takes up less space". I haven't had time to try your suggestion about using getField() and getFieldLength() for blobs. I'll try it in the next few days. My SQLRelay is version 0.36 with rudiments 0.28.2. Thanks again! Ville On Wed, 27 Jul 2005, David Muse wrote: > Ville, > > I have run some tests with my development version and the following > script works: > > #! /usr/bin/env python > > # Copyright (c) 2001 David Muse > # See the file COPYING for more information. > > from SQLRelay import PySQLRClient > import sys > import string > import cPickle > > con=PySQLRClient.sqlrconnection("localhost",8009,"/tmp/oracle8test.socket","oracle8test","oracle8test") > #con.debugOn() > cur=PySQLRClient.sqlrcursor(con) > > cur.sendQuery("drop table testtable"); > cur.sendQuery("create table testtable (col1 blob)") > > cur.prepareQuery("insert into testtable values(:val1)"); > sdata={'spam': {'eggs': 'spamspam', 'answers': {1:'', 2:'foo', > 3:'bar'}}} > bdata=cPickle.dumps(sdata) > blen=len(bdata) > cur.inputBindBlob('val1',bdata,blen) > cur.executeQuery() > > cur.sendQuery("select * from testtable"); > mydata=cPickle.loads(cur.getField(0,0)) > print mydata > > cur.sendQuery("select * from testtable"); > fields=cur.getRow(0) > mydata=cPickle.loads(fields[0]) > print mydata > > cur.sendQuery("drop table testtable"); > > > It prints out a tuple identical to the one sdata is set to. See if it > doesn't work for you too. If not, then there may be a bug specific to > the version of SQL Relay you're using. What version is that, by the > way? > > Dave > > > On Thu, 2005-07-21 at 16:10 +0100, Ville Silventoinen wrote: >> Hi Dave, >> >> Python len seems to be working correctly with pickled data. >> >> I did find out that cPickle.dumps(sdata) works ok. This generates string >> representation of the pickled data, which doesn't contain a \0 character. >> (I had a typo in my earlier test, the create procedure used string data, >> the modify procedure used binary, which is why I thought neither dumps >> worked.) >> >> If I use the HIGHEST_PROTOCOL with dumps, it generates binary data. This >> seems to have a problem with inputBindBlob(), unless I'm still doing >> something wrong. So if I am right, you should be able to recreate the >> problem with something like this: >> >> sdata={'spam': {'eggs': 'spamspam', 'answers': {1:'', 2:'foo', 3:'bar'}}} >> ... >> bdata = cPickle.dumps(sdata, 2) # uses HIGHEST_PROTOCOL >> blen = len(bdata) >> cur.inputBindBlob('colname', bdata, blen) >> ... >> # read the data by using normal select >> ... >> mydata = cPickle.loads(fields[0]) >> # this throws EOFError (at least in my case) >> >> I think '' generates \x00 or \x0, which becomes EOF with inputBindBlob. >> Perhaps it encodes \x00 as \0? Or maybe the problem is in the select? >> Is it ok to use normal select to read blobs? >> >> Thanks, >> Ville >> >> >> On Thu, 21 Jul 2005, Firstworks/4access wrote: >> >>> Ville, >>> >>> I was actually looking at that last night. I'm believe you're on track. >>> inputBind() does a strlen() of the string to decide how many characters >>> to store in the database. strlen() interprets \0's as end-of-string >>> markers, so only part of the data gets stored in the blob. Then, later >>> when you fetch and unpickle it, only part of it gets unpickled. I >>> believe the solution is to use inputBindBlob() or inputBindClob() rather >>> than inputBind() to store the pickled data. inputBindBlob() and >>> inputBindClob() take a length parameter and ignore \0's. >>> >>> Give it a try and let me know whether it works or not. >>> >>> Dave >>> dav...@fi... >>> >>> On Thu, 2005-07-21 at 12:31 +0100, Ville Silventoinen wrote: >>>> Hi, >>>> >>>> I'm using PySQLRClient from sqlrelay-0.36 (with rudiments-0.28.2) >>>> to store blobs in Oracle 9.2.0 database. >>>> >>>> I'm not sure if this has been fixed in the recent sqlrelay release, >>>> but I'm experiencing problems when I store a Python data structure >>>> (dictionary object) to a blob using Pythons cPickle module. Everything >>>> works great until one of the values in the pickled object is an empty >>>> string (''). After that cPickle.load fails to read the data, it raises >>>> EOFError exception. So I wonder if PySQLRClient interprets the pickled >>>> '' as an end-of-file character? >>>> >>>> If I try loading/saving similar data structure to a file, it works ok. >>>> >>>> Thanks for any advice, >>>> >>>> Ville >>>> >>>> >>>> >>>> >>>> ------------------------------------------------------- >>>> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies >>>> from IBM. Find simple to follow Roadmaps, straightforward articles, >>>> informative Webcasts and more! Get everything you need to get up to >>>> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click >>>> _______________________________________________ >>>> Sqlrelay-discussion mailing list >>>> Sql...@li... >>>> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion >>>> >>> >>> >>> >>> ------------------------------------------------------- >>> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies >>> from IBM. Find simple to follow Roadmaps, straightforward articles, >>> informative Webcasts and more! Get everything you need to get up to >>> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click >>> _______________________________________________ >>> Sqlrelay-discussion mailing list >>> Sql...@li... >>> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion >>> >> >> >> ------------------------------------------------------- >> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies >> from IBM. Find simple to follow Roadmaps, straightforward articles, >> informative Webcasts and more! Get everything you need to get up to >> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click >> _______________________________________________ >> Sqlrelay-discussion mailing list >> Sql...@li... >> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion >> > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO September > 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > |
From: David M. <dav...@fi...> - 2005-07-28 03:00:42
|
Hello all, I just uploaded 0.37pre1 to http://www.firstworks.com/sqlrelay-0.37pre1.tar.gz Here's the ChangeLog so far: integrated Charles Frank's SID code fixed bug in configure script where it would erroneously report that the MDB tools connection wouldn't be built uses (u)int[16|32]_t instead of short/long, etc. single-quotes and backslashes are escaped when using fake input binds now fixed "integer expression expected" error when running configure --disable-python changed "connections" to "instance id's" in /etc/sqlrelay sqlrsh's help displays help for ping/identify commands changed sybase installation instructions to use alien on debian de-supported python<2.1 clob/lob's aren't deleted if their length is 0 removed lago support fixed some bugs in tcl api added tcl tests added tcl docs I'm really interested in whether running an SQL Relay server on a 64 bit machine and an SQL Relay client on a 32 bit machine (or vice-versa) works. It should now, but I don't have a 64 bit machine to test it on. So, give it a try and let me know what you run into. Dave |
From: Hot D. <new...@ho...> - 2005-07-28 02:46:48
|
Worst, If you get the example on site (after correct the mistakes): $con = sqlrcon_alloc(HOST,PORT,"",USERNAME,USERPASSWORD,0,1); $cur = sqlrcur_alloc($con); sqlrcur_sendQuery($cur,"insert into banco values (1,2,3,4)"); $port = sqlrcon_getConnectionPort($con); $socket = sqlrcon_getConnectionSocket($con); $rs = sqlrcur_getResultSetId($cur); echo "port:". $port . " socket:" . $socket . " rs:" . $rs; // Show nothing, each reload show something (0,1) sqlrcur_suspendResultSet($cur); sqlrcon_suspendSession($con); sqlrcur_free($cur); sqlrcon_free($con); Someone use this function? Please, send to me an example... Thanks a lot.. >From: "Hot Dog" <new...@ho...> >Reply-To: sql...@li... >To: sql...@li... >Subject: [Sqlrelay-discussion] Problem with sqlrcur_getResultSetId >Date: Thu, 28 Jul 2005 02:34:40 +0000 > > Well, > > I am new with sqlrelay, I am trying to suspend and resume a session but >I cant get the ResultSetID, I have tried everything. > Using Fedora Core 4, Postgresql 8 e PHP 5, the code: > > $dados['rs'] = sqlrcur_getResultSetId($this->cur); > sqlrcur_suspendResultSet($this->cur); > sqlrcon_suspendSession($this->con); > $dados['port'] = sqlrcon_getConnectionPort($this->con); > $dados['socket'] = sqlrcon_getConnectionSocket($this->con); > return $dados; > > I have tried to change the order of lines, and nothing, always returns 0 >the function getResultSetId. > > Thanks for help... > >_________________________________________________________________ >MSN Messenger: instale grátis e converse com seus amigos. >http://messenger.msn.com.br > > > >------------------------------------------------------- >SF.Net email is Sponsored by the Better Software Conference & EXPO >September >19-22, 2005 * San Francisco, CA * Development Lifecycle Practices >Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA >Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf >_______________________________________________ >Sqlrelay-discussion mailing list >Sql...@li... >https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion _________________________________________________________________ MSN Messenger: instale grátis e converse com seus amigos. http://messenger.msn.com.br |
From: Hot D. <new...@ho...> - 2005-07-28 02:35:49
|
Well, I am new with sqlrelay, I am trying to suspend and resume a session but I cant get the ResultSetID, I have tried everything. Using Fedora Core 4, Postgresql 8 e PHP 5, the code: $dados['rs'] = sqlrcur_getResultSetId($this->cur); sqlrcur_suspendResultSet($this->cur); sqlrcon_suspendSession($this->con); $dados['port'] = sqlrcon_getConnectionPort($this->con); $dados['socket'] = sqlrcon_getConnectionSocket($this->con); return $dados; I have tried to change the order of lines, and nothing, always returns 0 the function getResultSetId. Thanks for help... _________________________________________________________________ MSN Messenger: instale grátis e converse com seus amigos. http://messenger.msn.com.br |
From: David M. <dav...@fi...> - 2005-07-28 02:13:52
|
Honestly, I'm not sure. When I start up mysql, I get a single mysqld process, and starting SQL Relay (which opens 3 connections) doesn't cause any more mysqld processes to start. I assumed they're multiplexing clients through a single thread, but I'm really not sure how it works. The 10 mysqld's you're seeing might be threads that aren't related to incoming clients at all, like a logger thread, a thread connected to each database file, a listener thread, etc. There may be configuration options that control the number of threads or processes that start up. I really don't know. I'll see if the mysql online documentation has any info on the subject. David Muse dav...@fi... On Tue, 2005-07-26 at 17:48 -0400, Tony Burger wrote: > I'm running sqlrelay 0.36.4 with MySQL 4.1 on a tinysofa.org linux 2.6 > kernel and connect via Python scripts. Everything is setup OK and runs > fine. When I start the MySQL server, it appears to start up 10 sessions > (via ps -ef). I see one of these lines: > root 982 1 0 16:33 pts/0 00:00:00 /bin/sh > /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data > --pid-file=/usr/local/ > > and 10 of these lines: > mysql 1014 982 0 16:34 pts/0 00:00:00 /usr/local/mysql/libexec/mysqld > --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --us > > When I fire up sqlrelay, I get an additional (x) number of the second > lines above based on the intial number of connections I set in the > sqlrelay.conf file. Is there a way to make sqlrelay use one of the > existing sessions already started? Or can I alter the MySQL my.cnf file > to not start as many connections? Anyone know how this works? Thanks! > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > |
From: David M. <dav...@fi...> - 2005-07-28 02:08:54
|
Ville, I have run some tests with my development version and the following script works: #! /usr/bin/env python # Copyright (c) 2001 David Muse # See the file COPYING for more information. from SQLRelay import PySQLRClient import sys import string import cPickle con=PySQLRClient.sqlrconnection("localhost",8009,"/tmp/oracle8test.socket","oracle8test","oracle8test") #con.debugOn() cur=PySQLRClient.sqlrcursor(con) cur.sendQuery("drop table testtable"); cur.sendQuery("create table testtable (col1 blob)") cur.prepareQuery("insert into testtable values(:val1)"); sdata={'spam': {'eggs': 'spamspam', 'answers': {1:'', 2:'foo', 3:'bar'}}} bdata=cPickle.dumps(sdata) blen=len(bdata) cur.inputBindBlob('val1',bdata,blen) cur.executeQuery() cur.sendQuery("select * from testtable"); mydata=cPickle.loads(cur.getField(0,0)) print mydata cur.sendQuery("select * from testtable"); fields=cur.getRow(0) mydata=cPickle.loads(fields[0]) print mydata cur.sendQuery("drop table testtable"); It prints out a tuple identical to the one sdata is set to. See if it doesn't work for you too. If not, then there may be a bug specific to the version of SQL Relay you're using. What version is that, by the way? Dave On Thu, 2005-07-21 at 16:10 +0100, Ville Silventoinen wrote: > Hi Dave, > > Python len seems to be working correctly with pickled data. > > I did find out that cPickle.dumps(sdata) works ok. This generates string > representation of the pickled data, which doesn't contain a \0 character. > (I had a typo in my earlier test, the create procedure used string data, > the modify procedure used binary, which is why I thought neither dumps > worked.) > > If I use the HIGHEST_PROTOCOL with dumps, it generates binary data. This > seems to have a problem with inputBindBlob(), unless I'm still doing > something wrong. So if I am right, you should be able to recreate the > problem with something like this: > > sdata={'spam': {'eggs': 'spamspam', 'answers': {1:'', 2:'foo', 3:'bar'}}} > ... > bdata = cPickle.dumps(sdata, 2) # uses HIGHEST_PROTOCOL > blen = len(bdata) > cur.inputBindBlob('colname', bdata, blen) > ... > # read the data by using normal select > ... > mydata = cPickle.loads(fields[0]) > # this throws EOFError (at least in my case) > > I think '' generates \x00 or \x0, which becomes EOF with inputBindBlob. > Perhaps it encodes \x00 as \0? Or maybe the problem is in the select? > Is it ok to use normal select to read blobs? > > Thanks, > Ville > > > On Thu, 21 Jul 2005, Firstworks/4access wrote: > > > Ville, > > > > I was actually looking at that last night. I'm believe you're on track. > > inputBind() does a strlen() of the string to decide how many characters > > to store in the database. strlen() interprets \0's as end-of-string > > markers, so only part of the data gets stored in the blob. Then, later > > when you fetch and unpickle it, only part of it gets unpickled. I > > believe the solution is to use inputBindBlob() or inputBindClob() rather > > than inputBind() to store the pickled data. inputBindBlob() and > > inputBindClob() take a length parameter and ignore \0's. > > > > Give it a try and let me know whether it works or not. > > > > Dave > > dav...@fi... > > > > On Thu, 2005-07-21 at 12:31 +0100, Ville Silventoinen wrote: > >> Hi, > >> > >> I'm using PySQLRClient from sqlrelay-0.36 (with rudiments-0.28.2) > >> to store blobs in Oracle 9.2.0 database. > >> > >> I'm not sure if this has been fixed in the recent sqlrelay release, > >> but I'm experiencing problems when I store a Python data structure > >> (dictionary object) to a blob using Pythons cPickle module. Everything > >> works great until one of the values in the pickled object is an empty > >> string (''). After that cPickle.load fails to read the data, it raises > >> EOFError exception. So I wonder if PySQLRClient interprets the pickled > >> '' as an end-of-file character? > >> > >> If I try loading/saving similar data structure to a file, it works ok. > >> > >> Thanks for any advice, > >> > >> Ville > >> > >> > >> > >> > >> ------------------------------------------------------- > >> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > >> from IBM. Find simple to follow Roadmaps, straightforward articles, > >> informative Webcasts and more! Get everything you need to get up to > >> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > >> _______________________________________________ > >> Sqlrelay-discussion mailing list > >> Sql...@li... > >> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > >> > > > > > > > > ------------------------------------------------------- > > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > > from IBM. Find simple to follow Roadmaps, straightforward articles, > > informative Webcasts and more! Get everything you need to get up to > > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > > _______________________________________________ > > Sqlrelay-discussion mailing list > > Sql...@li... > > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > |
From: Chris F. <Ch...@si...> - 2005-07-27 22:21:52
|
Hi David, =20 The online documentation mentions that there "should be an idle timeout feature in 0.36 ..." Was such a feature ever implemented? I cannot find any mention of it in the Changelog. =20 Thanks! Chris =20 Chris Falk Senior Software Engineer siberra DIGITAL MEDIA SYSTEMS Tel: 604-696-3224 Fax: 604-696-3201 ch...@si... <mailto:ch...@si...>=20 www.siberra.com <http://www.siberra.com/>=20 =20 |
From: David M. <dav...@fi...> - 2005-07-27 01:59:03
|
It should be ok to use select to fetch a blob. But, since the blob may contain NULLs, you need to use both getField() and getFieldLength() to deal with it. I wonder what cPickle.loads() does to decide how long the array of binary data is. Maybe it stores it in the beginning of the array or something. I'll run some tests and see what I get. Dave dav...@fi... On Thu, 2005-07-21 at 16:10 +0100, Ville Silventoinen wrote: > Hi Dave, > > Python len seems to be working correctly with pickled data. > > I did find out that cPickle.dumps(sdata) works ok. This generates string > representation of the pickled data, which doesn't contain a \0 character. > (I had a typo in my earlier test, the create procedure used string data, > the modify procedure used binary, which is why I thought neither dumps > worked.) > > If I use the HIGHEST_PROTOCOL with dumps, it generates binary data. This > seems to have a problem with inputBindBlob(), unless I'm still doing > something wrong. So if I am right, you should be able to recreate the > problem with something like this: > > sdata={'spam': {'eggs': 'spamspam', 'answers': {1:'', 2:'foo', 3:'bar'}}} > ... > bdata = cPickle.dumps(sdata, 2) # uses HIGHEST_PROTOCOL > blen = len(bdata) > cur.inputBindBlob('colname', bdata, blen) > ... > # read the data by using normal select > ... > mydata = cPickle.loads(fields[0]) > # this throws EOFError (at least in my case) > > I think '' generates \x00 or \x0, which becomes EOF with inputBindBlob. > Perhaps it encodes \x00 as \0? Or maybe the problem is in the select? > Is it ok to use normal select to read blobs? > > Thanks, > Ville > > > On Thu, 21 Jul 2005, Firstworks/4access wrote: > > > Ville, > > > > I was actually looking at that last night. I'm believe you're on track. > > inputBind() does a strlen() of the string to decide how many characters > > to store in the database. strlen() interprets \0's as end-of-string > > markers, so only part of the data gets stored in the blob. Then, later > > when you fetch and unpickle it, only part of it gets unpickled. I > > believe the solution is to use inputBindBlob() or inputBindClob() rather > > than inputBind() to store the pickled data. inputBindBlob() and > > inputBindClob() take a length parameter and ignore \0's. > > > > Give it a try and let me know whether it works or not. > > > > Dave > > dav...@fi... > > > > On Thu, 2005-07-21 at 12:31 +0100, Ville Silventoinen wrote: > >> Hi, > >> > >> I'm using PySQLRClient from sqlrelay-0.36 (with rudiments-0.28.2) > >> to store blobs in Oracle 9.2.0 database. > >> > >> I'm not sure if this has been fixed in the recent sqlrelay release, > >> but I'm experiencing problems when I store a Python data structure > >> (dictionary object) to a blob using Pythons cPickle module. Everything > >> works great until one of the values in the pickled object is an empty > >> string (''). After that cPickle.load fails to read the data, it raises > >> EOFError exception. So I wonder if PySQLRClient interprets the pickled > >> '' as an end-of-file character? > >> > >> If I try loading/saving similar data structure to a file, it works ok. > >> > >> Thanks for any advice, > >> > >> Ville > >> > >> > >> > >> > >> ------------------------------------------------------- > >> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > >> from IBM. Find simple to follow Roadmaps, straightforward articles, > >> informative Webcasts and more! Get everything you need to get up to > >> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > >> _______________________________________________ > >> Sqlrelay-discussion mailing list > >> Sql...@li... > >> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > >> > > > > > > > > ------------------------------------------------------- > > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > > from IBM. Find simple to follow Roadmaps, straightforward articles, > > informative Webcasts and more! Get everything you need to get up to > > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > > _______________________________________________ > > Sqlrelay-discussion mailing list > > Sql...@li... > > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > |
From: David M. <dav...@fi...> - 2005-07-27 01:55:51
|
I believe you need to use 2 cursors in your code. $this->_masterDb = & Db::getDb("sqlrelay",9001); $this->_cur = sqlrcur_alloc( $this->_masterDb ); sqlrcur_sendQuery( $this->_cur, "set names 'utf8'" ); sqlrcur_sendQuery( $this->_cur, $query ); $result = $this->convertFromEmptySqlRelayResult($this->_cur); $this->_cur2 = sqlrcur_alloc( $this->_masterDb ); sqlrcur_sendQuery($this->_cur2, "SELECT LAST_INSERT_ID() as Insert_ID"); $row = sqlrcur_getRowAssoc($this->_cur2, 0); $this->log->debug("Row is ".LogUtil::format($row)); $result->setInsertID($row["Insert_ID"]); sqlrcur_free($this->_cur); sqlrcur_free($this->_cur2); sqlrcon_endSession($this->_masterDb); Each cursor can only keep track of a single result set. If you run 1 query (in this case $query) and then use the same cursor to run another query (in this case "select LAST_INSERT_ID() as Insert_ID") then the result set of $query will be lost. In this short bit of code, it doesn't matter, but if it had called $result->Affected_Rows() after running "select LAST_INSERT_ID()..." then it $result->Affected_Rows() would return the number of affected rows from "select LAST_INSERT_ID()..." because the cursor that was attached to $result was reused for that query. I added sqlrcur_free calls above where it's safe to delete the cursors. Also, sqlrcur_getRowAssoc() requires 2 parameters: the cursor and the row number. In this case, row 0. I added the second parameter in the code above too. Give it a try and let me know how it goes. David Muse dav...@fi... On Fri, 2005-07-22 at 09:25 +0800, linuxman wrote: > Work it out! > > It seemed that, this line: > > $row = sqlrcur_getRowAssoc($this->_cur); > > has something wrong, I replace this line with: > > $insertId = sqlcrur_getField($this->_cur, 0, "Insert_ID"); > > then everything go well... > > But another problem, I don't know when to free the resources that > sqlrcon_alloc and sqlrcur_alloc applied? > > The trick is that, I can not free the cursor returned by > sqlcur_sendQuery just after sendQuery finished, because I must > transfer the cursor to resultset as the parameter. > > Thanks! > > > > > ______________________________________________________________________ > 发件人: sql...@li... > [mailto:sql...@li...] 代表 Josh > Johnson > 发送时间: 2005年7月21日 23:08 > 收件人: sql...@li... > 主题: Re: [Sqlrelay-discussion] 答复: [Sqlrelay-discussion] about > insert_id > > > > I had a feeling it was more complicated than I thought :) I haven't > used sqlrelay enough (I've been using it with PEAR) to have run into > this problem myself, but it's something I'll have to deal with too... > > -- JJ > > linuxman wrote: > > thanks for JJ's quick response ! > > > > The code below is from the model class of my application: > > > > .... > > if the $query is insert something: > > > > $this->_masterDb = & Db::getDb("sqlrelay",9001); > > $this->_cur = sqlrcur_alloc( $this->_masterDb ); > > sqlrcur_sendQuery( $this->_cur, "set names 'utf8'" ); > > sqlrcur_sendQuery( $this->_cur, $query ); > > > > $result = > > $this->convertFromEmptySqlRelayResult($this->_cur); > > > > sqlrcur_sendQuery($this->_cur, "SELECT LAST_INSERT_ID() as > > Insert_ID"); > > $row = sqlrcur_getRowAssoc($this->_cur); > > $this->log->debug("Row is ".LogUtil::format($row)); > > $result->setInsertID($row["Insert_ID"]); > > sqlrcon_endSession($this->_masterDb); > > > > and convertFromEmptySqlRelayResult is here: > > > > function convertFromEmptySqlRelayResult( $cur ){ > > $recordset = new EmptyMysqlResultSet_SqlRelay( $cur ); > > return $recordset; > > } > > > > And, EmptyMysqlResultSet_SqlRelay is defined as below: > > > > class EmptyMysqlResultSet_SqlRelay{ > > var $fields = false; > > var $EOF = true; > > function MoveNext() {return;} > > function RecordCount() {return 0;} > > function FieldCount() {return 0;} > > function EOF(){return TRUE;} > > function Close(){return true;} > > > > function emptyMysqlResultSet_SqlRelay($cur){ > > $this->cursor = $cur; > > } > > > > function Affected_Rows(){ > > return sqlrcur_affectedRows($this->cursor); > > } > > > > function setInsertID($id){ > > $this->insert_ID = $id; > > } > > > > function getInsertID(){ > > return $this->insert_ID; > > } > > } > > > > You see, sqlrelay is running port 9001, the query is like "INSERT ....". > > > > But the problem is, SELECT LAST_INSERT_ID() always return 0, I know this by > > watch the log output of "$this->log->debug("Row is > > ".LogUtil::format($row))". > > > > Any problem of my codes ? or any other way to get insert id? > > > > Thanks! > > > > -----邮件原件----- > > 发件人: sql...@li... > > [mailto:sql...@li...] 代表 Josh Johnson > > 发送时间: 2005年7月21日 22:14 > > 收件人: sql...@li... > > 主题: Re: [Sqlrelay-discussion] about insert_id > > > > try: SELECT LAST_INSERT_ID(); > > > > -- JJ > > > > linuxman wrote: > > > > > > > hi all, > > > > > > I use mysql+php+adodb in my web application, and want to use sqlrelay > > > as database polling. But, I don't know how to get insert id just after > > > inserting a record with sqlrelay? you know , there is Insert_ID in > > > adodb to get the insert id, but I have not find the same function in > > > the php api of sqlrelay. > > > > > > I used the 0.36 version of sqlrelay. > > > > > > Any hints? Thanks in advance! > > > > > > Linuxman > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > > > > > >from IBM. Find simple to follow Roadmaps, straightforward articles, > > > > > informative Webcasts and more! Get everything you need to get up to > > > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > > > _______________________________________________ > > > Sqlrelay-discussion mailing list > > > Sql...@li... > > > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from > > IBM. Find simple to follow Roadmaps, straightforward articles, informative > > Webcasts and more! Get everything you need to get up to speed, fast. > > http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > > _______________________________________________ > > Sqlrelay-discussion mailing list > > Sql...@li... > > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > > > > > > > > > > ------------------------------------------------------- > > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > > from IBM. Find simple to follow Roadmaps, straightforward articles, > > informative Webcasts and more! Get everything you need to get up to > > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click > > _______________________________________________ > > Sqlrelay-discussion mailing list > > Sql...@li... > > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > > > |
From: David M. <dav...@fi...> - 2005-07-27 01:36:52
|
Hmm. That is interesting. I get the same result when I try it and it works when I run a bunch of client programs. I guess mysql multiplexes client connections through a single process these days. David Muse dav...@fi... On Fri, 2005-07-22 at 17:15 +0800, linuxman wrote: > hi all, > > Here is pstree output in my debian/linux box: > sqlr-cachemanag > 10*[sqlr-connection] > 2*[sqlr-listener] > 2*[sqlr-scaler] > > and, only one mysqld daemon there! very strange here. > > The problem is, is it normal or something wrong with my sqlrelay > configuration? > > Here is my sqlrelay.conf: > > <?xml version="1.0"?> > <!DOCTYPE instances SYSTEM "sqlrelay.dtd"> > > <instances> > > <instance id="test1" port="9000" > socket="/usr/local/firstworks/var/sqlrelay/tmp/sqlrelay_9000.sock" > dbase="mysql" connections="5" maxconnections="75" > maxqueuelength="5" growby="5" ttl="60" endofsession="commit" > sessiontimeout="600" runasuser="sqlrelay" > runasgroup="sqlrelay" cursors="5" authtier="listener" handoff="pass" > deniedips="" allowedips="" debug="connection"> > <users> > <user user="root" password="xxx"/> > </users> > <connections> > <connection connectionid="test" > string="user=root;password=xxx;db=xxx;socket=/var/run/mysqld/mysqld.sock" /> > </connections> > </instance> > > <instance id="test2" port="9001" > socket="/usr/local/firstworks/var/sqlrelay/tmp/sqlrelay_9001.sock" > dbase="mysql" connections="5" maxconnections="75" > maxqueuelength="5" growby="1" ttl="60" endofsession="commit" > sessiontimeout="600" runasuser="sqlrelay" runasgroup="sqlrelay" > cursors="5" authtier="listener" handoff="pass" deniedips="" > allowedips="" debug="connection"> > <users> > <user user="root" password="xxx"/> > </users> > <connections> > <connection connectionid="test3" > string="user=root;password=xxx;db=test;host=localhost;port=3306" /> > </connections> > </instance> > </instances> > > Thanks in advance! > > linuxman |