https://bugs.freedesktop.org/show_bug.cgi?id=88601

            Bug ID: 88601
           Summary: LO BASE: Failure to correctly interpret range for
                    UNSIGNED integers from MySQL database (jdbc and native
                    connectors)
           Product: LibreOffice
           Version: 4.3.5.2 release
          Hardware: Other
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Database
          Assignee: [email protected]
          Reporter: [email protected]

SHORT DESCRIPTION:  LO Base uses incorrect range of values for UNSIGNED
integers in MySQL/MariaDB tables.  LO and/or its connectors treat UNSIGNED
integer fields as if they are SIGNED and resulting in unexpected/erroenous
outcomes.  Erroneous functionality regardless of connector (two jdbc connectors
tested, along with direct LO native connector), so reporting here.

DETAILED DESCRIPION:

1.  Create MySQL/MariaDB database with Table1;
2.  On Table1 create Field1 as UNSIGNED TinyInt;

NOTE:  UNSIGNED TinyInt has range 0 to 255.

3.  Connect to MySQL database using any method with LO Base; and,
4.  In table, attempt to enter value into Field1 of 128 to 255.  (these values
can successfully be entered directly into MySQL field without LO)

UNEXPECTED RESULT:

JBDC Drivers (com.mysql.jdbc.Driver and org.mariadb.jdbc.Driver)
"Error Updating Record // Data truncation:  Out of range value for column
'Field1' at row 1"

"SQL Status: 22001 // Error code: 1264"

Also received 22003.

MySQL Native Connector did not return error, simply (erroenously) changed
out-of-range value between 128 and 255 to 0 and saved.

ALTERNATIVELY:
At step 4. substitute a value of -1 to -128.

ALTERNATIVE UNEXPECTED RESULT:  On loss of focus, value will change to the
product of the following equation:

NewValue = 256 + TypedValue

That is, a value of negative one will change to a NewValue of 255.

Then, as noted above, attempting to save record will result in error above for
jdbc drivers.  Native connector just changes the value and saves, usually the
value 0.

NOTE ALSO:
If values 128 to 255 already are stored in Field1, they will be correctly
displayed in the table view.  However, they will not be displayed correctly on
a form in a numeric field.  The form view just displays zero.

PRESENT WORKAROUND is to use bigger integer types so that I do not encounter
this bug.  However, other UNSIGNED integer types also appear to be affected by
this bug, just need bigger numbers to encounter them.  

Unable to test on odbc connector.  

Attempted to test on HSQLDB Embedded (LO type) but it does not support unsigned
integer types, which is the difference that presumably resulted in this bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to