« September 2008 | Main | February 2009 »

December 2008 Archives

December 9, 2008

SQL Databases: A funny distinction between CHAR, VARCHAR with LIKE

I thought this was a horrible Postgres 8.3.5 bug.
create temporary table foo ( nummer character(12) );
insert into foo ( nummer) values( '1848' ) ;
select count(*) from foo where nummer = '1848' ;
-- returns 1
select count(*) from foo where nummer like '1848' ;
-- returns 0
drop table foo; 
Now the Postgres documentation claims :

If pattern does not contain percent signs or underscore, then the pattern only represents the string itself; in that case LIKE acts like the equals operator.

which is obviously not the case here.

To me that looks like an obvious and glaring bug, yet interestingly the same behaviour is also apparent in Oracle 10.1 and supposedly Frontbase. Whereas MySQL 4 and Sybase 12 behave as I would expect them to.

When the database type is changed to varchar, then the behaviour is as expected:

create temporary table bar ( nummer character varying );
insert into bar ( nummer) values( '1848' ) ;
select count(*) from bar where nummer = '1848' ;
-- returns 1
select count(*) from bar where nummer like '1848' ;
-- returns 1
drop table bar; 

C# .NET 3D Frameworks - Part III

Mogre the last of the C# .NET 3D Framework candidates is now months behind Ogre, the library it's wrapping. This and a quick look at the forums gives all the indications, that this framework will stale away rather sooner than later.

My conclusion is, that I will not use wrapped frameworks, even if the wrapper is maintained by the originators. If the wrapper framework is maintained by a third party, people inevitably will lose interest at some time and the wrapper stales. If the wrapper is maintained by the original frameworks maintainers, it's obviously not their choice language in the first place and the same thing will happen. Wrappers can't win and consequently they also don't.

About December 2008

This page contains all entries posted to Nat!'s Web Journal in December 2008. They are listed from oldest to newest.

September 2008 is the previous archive.

February 2009 is the next archive.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 4.25