[geeklog-devel] Re : [geeklog-cvs]Geeklog-1.x/public_htmllib-common.php, 1.675, 1.676 usersettings.php, 1.167, 1.168

Randy Kolenko randy at nextide.ca
Mon Feb 18 08:57:09 EST 2008


Just to add to this thread:

There was/is a limitation in the PHP MSSQL driver that truncates varchar
fields to 255 characters on display. 
Whether that limitation has been rectified or will soon be rectified,
all data display code would truncate data at the 256 character mark.
You get around this by CASTing the varchar to TEXT on display.  

I'm not sure whether the PHP driver limitation been rectified with the
recent PHP releases.  I would have to investigate into that angle a
little further.

I would have to test the latest PHP release to see if this has been
addressed.

-randy



> 
> 
> Keep in mind why I chose varchar 5000.  This was to retain 
> the search and display abilities for the first implementation 
> of the MSSQL layer and not to destroy all of the story, 
> search and display mechanisms in place.  You cannot use LIKE 
> clause on a text field. You would have to cast those to 
> varchar (8000) to do any textual comparisons on the field.  I 
> had to choose a data size that would also fit within the 
> maximum row length for sql server as well.  So it was a 
> compromise at the time.
> 
> The real workaround for sql server would be to change the DB 
> fields to text (to keep sql 2000 support) and introduce a new 
> mssql select statement for any of those specific areas where 
> the text field is being used.  
>  
>  -randy
>  
>  
> > 
> > > -----Original Message-----
> > > From: Michael Jervis [mailto:mjervis at gmail.com]
> > > Sent: Saturday, February 16, 2008 3:31 AM
> > > To: Geeklog Development
> > > Subject: Re: [geeklog-devel] [geeklog-cvs]
> > > Geeklog-1.x/public_htmllib-common.php, 1.675, 1.676 
> > > usersettings.php, 1.167, 1.168
> > > 
> > > 
> > > >  Of course in MSSQL this was always a problem and this
> > fix is mySQL
> > > > specific.
> > > >
> > > >  CREATE TABLE [dbo].[{$_TABLES['blocks']}] (
> > > >      [bid] [numeric](5, 0) IDENTITY (1, 1) NOT NULL ,
> > > >  ...
> > > >      [content] [varchar] (5000) COLLATE
> > > SQL_Latin1_General_CP1_CI_AS
> > > > NULL ,
> > > 
> > > Well I'd say that my fix is correct and the SQL Server 
> > > implementation is wrong. If the MySQL field is 65k of characters, 
> > > then having a 5000 character field in the MSSQL implementation is 
> > > very wrong. Problem is that the maximum length of a 
> Varchar in SQL 
> > > Server is 8000. nvarchar is 4000. Needs to be a text field in SQL 
> > > Server, which is 2^31 - 1 characters. Which is clearly 
> way more than 
> > > the MySQL implementation but 5k is too small if MySQL is 65k.
> > > 
> > > SQL Server 2000's text field is deprecated for 
> varchar(max) in 2005, 
> > > just to confuse matters further though!
> > > 
> > > (In the midst of a SQL Server 2000 -> 2005 migration at 
> work for our 
> > > product, with several hundred tables and over 3000 stored
> > > procedures...) _______________________________________________
> > > geeklog-devel mailing list
> > > geeklog-devel at lists.geeklog.net 
> > > http://eight.pairlist.net/mailman/listinfo/gee> klog-devel
> > > 
> > 
> 
> _______________________________________________
> geeklog-devel mailing list
> geeklog-devel at lists.geeklog.net
> http://eight.pairlist.net/mailman/listinfo/geeklog-devel
> 




More information about the geeklog-devel mailing list