Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #16808

Re: Closing a statement causes a "malformed object" error on theresult - by design ?

From "Christoph M. Becker" <cmbecker69@arcor.de>
Newsgroups comp.lang.php
Subject Re: Closing a statement causes a "malformed object" error on theresult - by design ?
Date 2016-06-28 19:29 +0200
Organization solani.org
Message-ID <nkuc6a$7r5$2@solani.org> (permalink)
References (5 earlier) <nkr9vk$boi$1@solani.org> <57713b8f$0$5833$e4fe514c@news.xs4all.nl> <577254c2$0$5937$e4fe514c@news.xs4all.nl> <nkttrg$g1i$1@solani.org> <5772a821$0$5907$e4fe514c@news.xs4all.nl>

Show all headers | View raw


On 28.06.2016 at 18:41, R.Wieser wrote:

> Christoph M. Becker <cmbecker69@arcor.de> schreef in berichtnieuws
> nkttrg$g1i$1@solani.org...
>
>> | Warning: SQLite3Result::fetchArray(): The SQLite3Stmt object
>> | has not been correctly initialised
> 
> Remove the word "correctly" (a word which seems to indicate either some kind
> of system failure, or something else that also needs to be done) and its
> indeed actual cause of the function (method) not being able to perform its
> task.

Hm, it seems your right.  I'll check some of the other messages; some of
them might be similarly strange.

> prepare - bind - execute(1) - bind - execute(2) - fetchArray(1) -
> fetchArray(2)
> 
> In the above case both of the above fetchArray calls, even though they are
> called on different results objects, seem to be eating from the same
> through.   As if every statement object can only maintain a single set of
> result data.

Indeed, that's the case.  Consider that fetchArray() basically just
calls sqlite3_step – always on the same statement object.  Of course,
this should be documented.

>> No, at least not generally.  The Zend engine does track object
>> dependencies wrt. automatic memory management.
> 
> Good to know.   Though than odd that it doesn't quite seem to work for the
> SQLite3Stmt object ...  There must be more to it.

The crux is that non memory-management related dependencies are not
catered to by the Zend engine.  That's up to the extension.

The actual design of the sqlite3 extension wrt. statement and their
results might not be optimal, but it's rather unlikely that this will be
changed (for backward compatibility reasons).  It might be possible to
do that for PHP 8.0, but even that would require the RFC process, and
the RFC might be declined.  Not sure, if that would be worth the effort.

> I probably will have some fun time ahead by stumbling into other PHP and
> extension pitfals and trying to make sense of why they are/"need" to be
> there. :-)

Yes, most likely.  However, there is this newsgroup… :)

-- 
Christoph M. Becker

Back to comp.lang.php | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Closing a statement causes a "malformed object" error on the result - by design ? "R.Wieser" <address@not.available> - 2016-06-26 17:02 +0200
  Re: Closing a statement causes a "malformed object" error on the result - by design ? Jerry Stuckle <jstucklex@attglobal.net> - 2016-06-26 12:23 -0400
    Re: Closing a statement causes a "malformed object" error on theresult - by design ? "R.Wieser" <address@not.available> - 2016-06-26 22:07 +0200
      Re: Closing a statement causes a "malformed object" error on theresult - by design ? Jerry Stuckle <jstucklex@attglobal.net> - 2016-06-26 16:45 -0400
        Re: Closing a statement causes a "malformed object" error ontheresult - by design ? "R.Wieser" <address@not.available> - 2016-06-27 12:26 +0200
          Re: Closing a statement causes a "malformed object" error ontheresult - by design ? Jerry Stuckle <jstucklex@attglobal.net> - 2016-06-27 10:11 -0400
      Re: Closing a statement causes a "malformed object" error on theresult - by design ? "Peter H. Coffin" <hellsop@ninehells.com> - 2016-06-26 15:55 -0500
        Re: Closing a statement causes a "malformed object" error ontheresult - by design ? "R.Wieser" <address@not.available> - 2016-06-27 11:11 +0200
  Re: Closing a statement causes a "malformed object" error on the result - by design ? "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-06-27 01:33 +0200
    Re: Closing a statement causes a "malformed object" error on theresult - by design ? "R.Wieser" <address@not.available> - 2016-06-27 11:44 +0200
      Re: Closing a statement causes a "malformed object" error on theresult - by design ? "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-06-27 13:10 +0200
        Re: Closing a statement causes a "malformed object" error ontheresult - by design ? "R.Wieser" <address@not.available> - 2016-06-27 15:02 +0200
          Re: Closing a statement causes a "malformed object" error ontheresult - by design ? "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-06-27 15:33 +0200
            Re: Closing a statement causes a "malformed object" error on the result - by design ? "R.Wieser" <address@not.available> - 2016-06-27 16:45 +0200
              Re: Closing a statement causes a "malformed object" error on the result - by design ? "R.Wieser" <address@not.available> - 2016-06-28 12:45 +0200
                Re: Closing a statement causes a "malformed object" error on the result - by design ? "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-06-28 15:25 +0200
                Re: Closing a statement causes a "malformed object" error on theresult - by design ? "R.Wieser" <address@not.available> - 2016-06-28 18:41 +0200
                Re: Closing a statement causes a "malformed object" error on theresult - by design ? "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-06-28 19:29 +0200

csiph-web