2004-08-23 11:57:38 UTC
I'm using php5 and CVS 0.3 beta version, patched to support
definable field separators (with my provided patch)
Consider the following SQL query:
CREATE TABLE asignaturas (
codigo INT DEFAULT 11,
abreviatura TEXT DEFAULT 'NONE',
nombre TEXT DEFAULT 'Asignatura vacia',
semestre INT DEFAULT 1,
creditos INT DEFAULT 10
);
when executed i get the file:
[jantonio@jonsy labo-2004]$ cat asignaturas.txt
codigo:abreviatura:nombre:semestre:creditos
int:text:text:int:int
10:NONE:Asignatura vacia:1:10
that is correct.
Now change "creditos" default to 0. I'll get this file:
[jantonio@jonsy labo-2004]$ cat asignaturas.txt
codigo:abreviatura:nombre:semestre:creditos
int:text:text:int:int
10:NONE:Asignatura vacia:1:
!hey! ¿what happened with default value for "creditos"?
Things go worst when defaults to zero other fields:
- defaulting "semestre" to 0 gives:
[jantonio@jonsy labo-2004]$ cat asignaturas.txt
codigo:abreviatura:nombre:semestre
int:text:text:int
10:NONE:Asignatura vacia:
( last field dissapeared )
- and worst: defaulting "codigo" (first field) to zero gives me:
[jantonio@jonsy labo-2004]$ cat asignaturas.txt
codigo
int
totally broken.
So extrange things occurs when defaulting to zero. seems
that parser stop working...
¿any ideas?