php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26791 mssql.textlimit and mssql.textsize can't be set via ini_set()
Submitted: 2004-01-05 01:34 UTC Modified: 2004-01-09 19:15 UTC
From: danielc at analysisandsolutions dot com Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 4.3.4 OS: Windows 2000
Private report: No CVE-ID: None
 [2004-01-05 01:34 UTC] danielc at analysisandsolutions dot com
Description:
------------
The mssql.textlimit and mssql.textsize configuration options
can't be set via ini_set().  Changing them in php.ini works.

This is also the case in a recent PHP 5 snapshot (500rc1-dev--php5-win32-200401022330).

This is the same issue as bug 20797 which was closed due to no feedback.

SCRIPT CAN CHANGE LIMIT
=======================
    php.ini
        mssql.textlimit = 2147483647
        mssql.textsize = 2147483647
    script
        SET TEXTSIZE 20


SCRIPT CAN'T CHANGE LIMIT
=========================
    php.ini
        mssql.textlimit = 20
        mssql.textsize = 20
    script
        ini_set('mssql.textlimit', 2147483647);
        ini_set('mssql.textsize', 2147483647);

    ------------------------------------
    php.ini
        mssql.textlimit = 2147483647
        mssql.textsize = 2147483647
    script
        ini_set('mssql.textlimit', 20);
        ini_set('mssql.textsize', 20);

    ------------------------------------
    php.ini
        ; mssql.textlimit = 2147483647
        ; mssql.textsize = 2147483647
    script
        SET TEXTSIZE 2147483647

    ------------------------------------
    php.ini
        mssql.textlimit = 20
        mssql.textsize = 20
    script
        SET TEXTSIZE 2147483647



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-05 02:44 UTC] fmk@php.net
This works in PHP5 but not in PHP4.3.x (tested on the cvs version). Did something happen to the ini_set() funtion ?
 [2004-01-06 18:56 UTC] sniper@php.net
Frank, nothing has changed in that function. Are you sure this really works with PHP 5..?

 [2004-01-08 00:12 UTC] fmk@php.net
This seams to be related to how the extension is loaded.

ini_set() works fine in php4 whn the extension is loaded from php.ini, but not when dl() is used.

The dl() will also cause the output from phpinfo() to be incomplete!
 [2004-01-08 13:51 UTC] danielc at analysisandsolutions dot com
Know what?  The problem was where the ini_set() calls are made.  They must be done BEFORE the connection is established.  Once it's made, it can't be changed.

Oddly, it doesn't matter when one calls ini_set() for mssql.datetimeconvert.

So, I'm not sure this bug report should be closed, called bogus or not.  It might be nice to have these work regardless of where they are called.  If no change is made, the behavior needs to be documented.

Couple things to keep in mind about my config:
   Using CGI
   Loading mssql via php.ini extensions
   Versions 4.3.4 and php5-win32-200401081130 snapshot
 [2004-01-08 23:21 UTC] sniper@php.net
Of course the ini_set() has to be called before anything else is what might be using the setting. (this is the case for ANY setting, not just these mssql.* settings, see e.g. session stuff for examples)

 [2004-01-08 23:54 UTC] danielc at analysisandsolutions dot com
Sniper:

Don't be so dismissive.  Most ini_set()'s work just fine regardless of when they're called.  Sessions aren't a good example because all of the session stuff has to be processed before any output.

If the team doesn't want to spend time fixing this, please turn this into a documentation bug for ref.mssql.php, where a note should be made about the need to set these before connecting to a db.
 [2004-01-09 19:15 UTC] fmk@php.net
textsize and text limit are used by the mssql_connect() function so you need to specify the values before calling this function. datetimeconvert is used by the mssql_fetch_*() functions and must be set before calling any of these functions. This setting is an internal PHP feature and has nothing to do with the server.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 18:01:35 2024 UTC