Skip to content

This should break postgre - #27280

Closed
VicDeo wants to merge 2 commits into
masterfrom
pure-test
Closed

VicDeo wants to merge 2 commits into
masterfrom
pure-test

Conversation

@VicDeo

@VicDeo VicDeo commented Feb 28, 2017 •

Copy link
Copy Markdown
Contributor

Investigating types returned for integer field

Table:

 <table>
  <name>*dbprefix*decimal</name>
  <declaration>
   <field>
    <name>id</name>
    <autoincrement>1</autoincrement>
    <type>integer</type>
    <default>0</default>
    <notnull>true</notnull>
    <length>4</length>
   </field>

   <field>
    <name>decimaltest</name>
    <type>decimal</type>
    <default/>
    <notnull>true</notnull>
    <precision>12</precision>
    <scale>2</scale>
   </field>
  </declaration>
 </table>

I just fetch any id and assert it to be string:

                $actual = OC_DB::prepare("SELECT `id` FROM `$table`")->execute()->fetchOne();
 		$this->assertTrue(is_string($actual));

@VicDeo

VicDeo commented Feb 28, 2017 •

Copy link
Copy Markdown
Contributor Author

Result is:

✅ sqlite string(1)
✅ mysqlmb4 string(1)
✅ mysql string(1)
💥 pgsql - int(1)

Test\DB\LegacyDBTest::testSelectIntegerType Failed asserting that false is true.

hm... could this be related to PHP version? It is 5.6 for pgsql and 7.0+ for all the rest
Nope, tested with PHP 5.6.24/MySQL - result is string '1'

@VicDeo

VicDeo commented Feb 28, 2017

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 what do you think?

@VicDeo

VicDeo commented Mar 1, 2017 •

Copy link
Copy Markdown
Contributor Author

@PVince81

Copy link
Copy Markdown
Contributor

@VicDeo any update ? did you find a solution ?

@VicDeo

VicDeo commented Mar 17, 2017

Copy link
Copy Markdown
Contributor Author

@PVince81 yes, cast actual to string in tests.
Can be closed

@VicDeo VicDeo closed this Mar 17, 2017
@VicDeo
VicDeo deleted the pure-test branch March 17, 2017 14:56
@lock

lock Bot commented Aug 3, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants