Home » Database » MDB2_Schema » Bug #9181
Boolean Y in XML not working
Details
| Request #9181 | Boolean Y in XML not working |
|---|---|
| Submitted | 2006-10-27 14:19 UTC |
| From | m2calabr at dunamisdesign dot net |
| Assigned | ifeghali |
| Status | Closed |
| Package | MDB2_Schema |
| PHP Version | 5.0.4 |
| OS | n/a (linux) |
| Roadmaps | (Not assigned) |
Comments
[2006-10-27 14:19 UTC] m2calabr at dunamisdesign dot net
Description:
------------
You have just added null (<null/>), I would suggest added true and false as well e.g. <true/> and <false/>. That way the you can the driver can translate it to the correct value that is needed
true,t,1,Y
false,f,0,N
That way you do not have to guess what the backend needs when you are setting the value.
Thanks
[2006-10-27 16:03 UTC] m2calabr at dunamisdesign dot net
Yep that should, now I need to replicate the bug that prompted to submit this.
Quick version is: run 0.6.0 had <value>Y</value> for a boolean , loaded 0.7.0 booleans loaded as 0 (mysql). This broke my DB. Changed to <value>1</value>, all is well again. Give me a couple hours, and I will recheck, to see if it was an operator error,
OK I just checked,
v 0.6.0 OK
v 0.7.0 Y --- does not work
I am guess the implementation of a boolean was changed for mySQL.
If you want me to post my example DB xml please let me know.
[2006-10-28 03:49 UTC] m2calabr at dunamisdesign dot net
The code I am using to load the XML is the demodata.php which I got from the LiveUser project. The boolean isactive comes up as 0 in the mySQL DB. Before running demodata.php I do:
mysqladmin drop liveuser
mysqladmin create liveruser
php demodata.php -d mysql://u:p@localhost/liveuser -f apmenu-data.xml
I have clipped the rest of the tables and sequences.
XML segment:
--------------------------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<database>
<name><variable>database</variable></name>
<create><variable>create</variable></create>
<table>
<name>liveuser_users</name>
<declaration>
<field> <name>authuserid</name> <type>text</type> <length>32</length> </field>
<field> <name>handle</name> <type>text</type> <length>32</length> </field>
<field> <name>passwd</name> <type>text</type> <length>32</length> </field>
<field> <name>owner_user_id</name> <type>integer</type> </field>
<field> <name>owner_group_id</name><type>integer</type> </field>
<field> <name>lastlogin</name> <type>timestamp</type> </field>
<field> <name>isactive</name> <type>boolean</type> </field>
<field> <name>expiredate</name> <type>timestamp</type>
<comments>If this date is passed then the user can not log into the system.</comments>
</field>
<index>
<name>authuserid</name>
<unique>1</unique>
<field> <name>authuserid</name> <sorting>ascending</sorting> </field>
</index>
</declaration>
<initialization>
<insert>
<field> <name>authuserid</name> <value>c4ca4238a0b923820dcc509a6f75849b</value></field>
<field> <name>handle</name> <value>boss</value> </field>
<field> <name>passwd</name> <value>test</value> </field>
<field> <name>owner_user_id</name> <value><null/></value> </field>
<field> <name>owner_group_id</name> <value>1</value> </field>
<field> <name>lastlogin</name> <value><null/></value> </field>
<field> <name>isactive</name> <value>Y</value> </field>
<field> <name>expiredate</name> <value><null/></value> </field>
</insert>
<insert>
<field> <name>authuserid</name> <value>c81e728d9d4c2f636f067f89cc14862c</value></field>
<field> <name>handle</name> <value>operator</value> </field>
<field> <name>passwd</name> <value>test</value> </field>
<field> <name>owner_user_id</name> <value>1</value> </field>
<field> <name>owner_group_id</name> <value><null/></value> </field>
<field> <name>lastlogin</name> <value><null/></value> </field>
<field> <name>isactive</name> <value>Y</value> </field>
<field> <name>expiredate</name> <value><null/></value> </field>
</insert>
</initialization>
</table>
</database>