Fork me on GitHub
Subscribe 3

Ticket #1072 (fixed bug)

The DB class for SQLite doesn't maintain string values by default?

  • Created: 2016-01-06 06:36:28
  • Reported by: Visman
  • Assigned to: quy
  • Milestone: 1.5.10
  • Component: database
  • Priority: normal

sqlite.php file, add_field function:

		if ($default_value === '')
			$default_value = '\'\'';

		if (!is_null($default_value))
			$query .= ' DEFAULT '.$default_value;

If $default_value = 'jpg,jpeg,png,gif,mp3,zip,rar,7z', to query

... DEFAULT jpg,jpeg,png,gif,mp3,zip,rar,7z ...

Is it normal? smile

History

Franz 2016-01-06 09:21:14

  • Milestone set to 1.5.10.

That's strange indeed.

quy 2016-01-14 13:58:39

I don't have an installation with SQLite yet, so I don't fully understand what the issue is. Please elaborate. Thanks.

Visman 2016-01-15 06:35:59

		if ($default_value === '')
			$default_value = '\'\'';

--->

		if (is_string($default_value))
			$default_value = '\''.$this->escape($default_value).'\'';

quy 2016-01-29 22:03:01

Commit 937c297 to fluxbb 1.5-next

#1072 Fix assigning default value in SQLite

quy 2016-01-29 22:05:55

I don't have SQLite to test. The code provided by Visman appears to be fine so here is the pull request:
https://github.com/fluxbb/fluxbb/pull/198

Franz 2016-01-29 22:09:36

Commit a11dd5e to fluxbb 1.5-next

Merge pull request #198 from Quy/1072-sqlite

#1072 Fix assigning default value in SQLite

quy 2016-01-29 22:14:27

  • Owner set to quy.
  • Status changed from open to fixed.

Thanks Visman.

quy 2016-06-16 07:54:52

Commit b08a455 to fluxbb master

#1072 Fix assigning default value in SQLite