logo       

Re: MySQL driver doc bug (was: how load works): msg#00022

Subject: Re: MySQL driver doc bug (was: how load works)
> Your test excluded creating the session table itself. Notice in the  
> docs for REPLACE INTO where it says that if there is no UNIQUE or  
> PRIMARY KEY constraint, then it will always INSERT, never update.

Ah ha. Indeed, here is the table I've been using:

CREATE TABLE sessions (
id CHAR(32) NOT NULL,
a_session TEXT NOT NULL
);

The docs do sort of complicate matters, as it's stated what the  
minimum table is for "most" SQL backends are here:

        http://search.cpan.org/~markstos/CGI-Session-4.14/lib/CGI/Session/ 
Driver/DBI.pm#STORAGE

But, the docs specifically for MySQL:

        http://search.cpan.org/~markstos/CGI-Session-4.14/lib/CGI/Session/ 
Driver/mysql.pm

Don't have any mention of how to create the table (so I have to  
guess?), but there are docs from the 3.x series:

        http://search.cpan.org/~sherzodr/CGI-Session-3.95/Session/MySQL.pm

(which I found just searching on CPAN for, easy to forget to look at  
the version numbers)

That do have directions for MySQL. Going through all that, I'm  
assuming the MySQL can use the generic table stated in the DBI.pm  
docs, and Postgres uses what is listed here:

        http://search.cpan.org/~markstos/CGI-Session-4.14/lib/CGI/Session/ 
Driver/postgresql.pm

OK, I can apply that change to my docs as well :)

Thanks for helping out with this;

Justin Simoni
-- 
:: is an eccentric artist, living and working in Denver, Colorado
:: URL: http://justinsimoni.com
:: PHO: 720.436.7701
:: Mailing List - http://justinsimoni.com/mailing_list.html


On Jul 30, 2006, at 9:48 PM, Mark Stosberg wrote:

> Justin Simoni wrote:
>>> There's probably a bug here. Could you boil this down to a  
>>> Test::More
>>> style test case? It looks like you are nearly there.
>> Done! Be gentle - this is my first real Test::More test - I know  
>> these are supposed to be pretty simple, but setting up all the DBI  
>> parameters seems a bit verbose, but I've attached it to this  
>> message, as well as attempted to place it inline (notes to follow  
>> code):
>
> Thanks Justin.
>
> I adapted this test for the SQLite driver... and it passed when it  
> fails for MySQL. So that points to something MySQL-specific.  
> Looking at the code for the MySQL driver, it does do something a  
> little different. It use the non-standard "REPLACE INTO" function.  
> It's documented here:
>
> http://sunsite.mff.cuni.cz/MIRRORS/ftp.mysql.com/doc/en/REPLACE.html
>
> Your test excluded creating the session table itself. Notice in the  
> docs for REPLACE INTO where it says that if there is no UNIQUE or  
> PRIMARY KEY constraint, then it will always INSERT, never update.
>
> That sounds a lot like your case. If that's the issue. we should  
> add a big note to the MySQL driver about that.
>
>    Mark
>
> -- 
> http://mark.stosberg.com/
>
>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe