To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=114304
                 Issue #|114304
                 Summary|Default not being set properly when creating a boolean
                        | field via SQL
               Component|Database access
                 Version|OOo 3.2.1
                Platform|Macintosh
                     URL|
              OS/Version|Mac OS X
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|none
             Assigned to|dbaneedsconfirm
             Reported by|anotheralan





------- Additional comments from [email protected] Sat Sep  4 11:06:02 
+0000 2010 -------
Using OpenOffice 3.2.1 (Build: 9502) on Mac OSX 10.6.4.

When attempting to use a direct SQL Create Table statement to set a default
value for a boolean field (via the Tools->SQL menu), the field is created
properly, but the default does not get applied. 

Based off the documentation here:
http://hsqldb.org/doc/guide/ch09.html#create_table-section

If this statement is run:
CREATE TABLE "testTable" ("testBool" BOOLEAN DEFAULT TRUE NOT NULL);

a new table should be created that has a "testBool" field the defaults to TRUE
(which would show up as "Yes" in the Base display). However, with the above
statement the default is actual set to FALSE (which shows up as "No" in the Base
display).

(Note: after running an SQL command to create a table, you need to run the
View->Refresh Tables menu option to see new tables.)

It does not appear that the default is being set improperly, but rather that the
default is being ignored all together. 


For some further examples, running the following:

CREATE TABLE "testTableB" (

  "pKey" INTEGER NOT NULL IDENTITY PRIMARY KEY,
  
  "test01" BOOLEAN DEFAULT TRUE NOT NULL,
  "test02" BOOLEAN DEFAULT True NOT NULL,
  "test03" BOOLEAN DEFAULT true NOT NULL,
  "test04" BOOLEAN DEFAULT 1 NOT NULL,
  
  "test05" BOOLEAN DEFAULT FALSE NOT NULL,
  "test06" BOOLEAN DEFAULT False NOT NULL,
  "test07" BOOLEAN DEFAULT false NOT NULL,
  "test08" BOOLEAN DEFAULT 0 NOT NULL,
  
  "test09" BOOLEAN DEFAULT TRUE,
  "test10" BOOLEAN DEFAULT True,
  "test11" BOOLEAN DEFAULT true,
  "test12" BOOLEAN DEFAULT 1,
  
  "test13" BOOLEAN DEFAULT FALSE,
  "test14" BOOLEAN DEFAULT False,
  "test15" BOOLEAN DEFAULT false,
  "test16" BOOLEAN DEFAULT 0

);

Will produce a table where all the fields with "NOT NULL" end up with a default
value of "No" regardless of if "TRUE" or "FALSE" was requested. Any fields
without the "NOT NULL" spec end up with a default of <none>.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to