CodeIgniter Forums
[split] Database problem since 3.1.6 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19)
+--- Thread: [split] Database problem since 3.1.6 (/showthread.php?tid=69382)



[split] Database problem since 3.1.6 - phpforever2017 - 11-12-2017

Hello, thanks for You work.
I'm use
PHP Code:
$this->dbutil->backup 
for backup DB from admin panel. After upgrade, in this a peace of code
PHP Code:
            while ($field $query->result_id->fetch_field())
            {
                
// Most versions of MySQL store timestamp as a string
                
$is_int[$i] = ($field->type MYSQLI_TYPE_TINY)
                        OR (
$field->type MYSQLI_TYPE_SHORT)
                        OR (
$field->type MYSQLI_TYPE_INT24)
                        OR (
$field->type MYSQLI_TYPE_LONG)
                        OR (
$field->type MYSQLI_TYPE_LONGLONG);

                
// Create a string of field names
                
$field_str .= $this->db->escape_identifiers($field->name).', ';
                
$i++;
            } 

returned field type integer, but in DB table this field is varchar.

Method _backup from CI_DB_mysqli_utility class return wrong data without escape string field


RE: [split] Database problem since 3.1.6 - Paradinight - 11-12-2017

(11-12-2017, 01:44 PM)phpforever2017 Wrote: Hello, thanks for You work.
I'm use
PHP Code:
$this->dbutil->backup 
for backup DB from admin panel. After upgrade, in this a peace of code
PHP Code:
while ($field $query->result_id->fetch_field())
 {
 
// Most versions of MySQL store timestamp as a string
 
$is_int[$i] = ($field->type MYSQLI_TYPE_TINY)
 OR (
$field->type MYSQLI_TYPE_SHORT)
 OR (
$field->type MYSQLI_TYPE_INT24)
 OR (
$field->type MYSQLI_TYPE_LONG)
 OR (
$field->type MYSQLI_TYPE_LONGLONG);

 
// Create a string of field names
 
$field_str .= $this->db->escape_identifiers($field->name).', ';
 
$i++;
 } 

returned field type integer, but in DB table this field is varchar.

Method _backup from CI_DB_mysqli_utility class return wrong data without escape string field

https://github.com/bcit-ci/CodeIgniter/issues/5276


RE: [split] Database problem since 3.1.6 - phpforever2017 - 11-19-2017

(11-12-2017, 10:24 PM)Paradinight Wrote: https://github.com/bcit-ci/CodeIgniter/issues/5276

Thanks


RE: [split] Database problem since 3.1.6 - resolv_25 - 01-06-2018

(11-19-2017, 05:51 PM)phpforever2017 Wrote:
(11-12-2017, 10:24 PM)Paradinight Wrote: https://github.com/bcit-ci/CodeIgniter/issues/5276

Thanks

Yes, this bug is still active, on export, I have line like this:

Code:
VALUES (54, value1, value2 , 2407000);


Mysql/MariaDB can't import value without quotes, it returns an error:
ERROR 1064 (42000)


RE: [split] Database problem since 3.1.6 - InsiteFX - 01-06-2018

Did you download the CodeIgniter Development Version and try it?