Development

#2887 (propel-dump-data failes to quote certain strings and propel-load-data fails to load boolean data.)

You must first sign up to be able to contribute.

Ticket #2887 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

propel-dump-data failes to quote certain strings and propel-load-data fails to load boolean data.

Reported by: shinji Assigned to: fabien
Priority: minor Milestone: 1.1.0
Component: model Version: 1.0.10
Keywords: Spyc dump-data load-data Cc: shinji-s@hat.hi-ho.ne.jp
Qualification: Unreviewed

Description

Attached patch fixes the following problems.

(1) Spyc assumes a class of string ('yes', 'n', '+', '-', 'true', 'false'...) to represent a boolean value. To designate string values of these, they must be quoted in yml file. However Spyc failes to do that when dumping data. Therefore when propel-dump-data followed by propel-load-data is performed, 'y' in a database column gets converted into '1', for example.

(2) pgsql_fetch_array() returns a boolean value as a string value ('t' or 'f').Therefore they gets dumped as 't' or 'f' in the output during propel-dump-data. When loaded into database using propel-load-data, both are coerced into boolean value 'true' since they are regarded as a string value.

Attachments

patch.diff (1.4 kB) - added by shinji on 02/05/08 00:59:05.
Fixes problem in propel-dump-data / propel-load-data

Change History

02/05/08 00:59:05 changed by shinji

  • attachment patch.diff added.

Fixes problem in propel-dump-data / propel-load-data

02/06/08 21:14:35 changed by synace

also happens in doctrine w/ "NO" in my case

02/06/08 21:21:03 changed by synace

i don't particularly agree w/ this method of patching though

this bug will also need patch in: /plugins/sfDoctrinePlugin/branches/0.1/lib/sfDoctrineData.class.php

03/14/08 21:57:22 changed by fabien

  • milestone set to 1.1.0.

03/14/08 22:59:38 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

(In [7892]) replaced Spyc with a new YAML parser/dumper (closes #3083, #2887, #2622, #2514, #1966, #1339, #3016)

  • removed Spyc
  • added sfYamlParser, sfYamlDumper (should be totally BC thanks to the unit tests)
  • the parser and the dumper are much more robust and much more easier to fix
  • exceptions are thrown when a non valid YAML file is parsed (when you forget a : after a key for example, or if the indentation is not right ;))
  • fixed a bunch of bugs of the old parser
  • speed is more or less the same as Spyc
  • added an option to control the dump to switch from the block to the flow notation (propel:build-schema is now much more readable in YAML)
  • added more unit tests