ezsql icon indicating copy to clipboard operation
ezsql copied to clipboard

Update Constants.php

Open dpDesignz opened this issue 3 years ago • 5 comments

Update _isNULL and _notNULL constants to allow checks to run correctly.

Discovered that the isNull and isNotNull where conditions were not firing correctly due to incorrectly declared constants.

dpDesignz avatar Feb 07 '22 09:02 dpDesignz

Codecov Report

Merging #213 (e690998) into master (4bc6a25) will increase coverage by 0.46%. The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #213      +/-   ##
============================================
+ Coverage     90.30%   90.76%   +0.46%     
  Complexity      838      838              
============================================
  Files            14       14              
  Lines          2083     2058      -25     
============================================
- Hits           1881     1868      -13     
+ Misses          202      190      -12     
Impacted Files Coverage Δ
lib/ezFunctions.php 89.09% <ø> (ø)
lib/Database/ez_pdo.php 91.44% <0.00%> (-1.61%) :arrow_down:
lib/Database/ez_sqlite3.php 90.76% <0.00%> (-0.77%) :arrow_down:
lib/Database/ez_sqlsrv.php 81.46% <0.00%> (+0.45%) :arrow_up:
lib/ezQuery.php 89.89% <0.00%> (+2.51%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4bc6a25...e690998. Read the comment docs.

codecov[bot] avatar Feb 07 '22 09:02 codecov[bot]

Update _isNULL and _notNULL constants to allow checks to run correctly.

Discovered that the isNull and isNotNull where conditions were not firing correctly due to incorrectly declared constants.

Those constants also suppose to build create the actual SQL query string format. There might not be enough or no tests covering them. The ezFunctionsTest.php does not actually touch any database.

Seems the Windows Github Actions Ci needs fixing now.

TheTechsTech avatar Feb 07 '22 20:02 TheTechsTech

Update _isNULL and _notNULL constants to allow checks to run correctly. Discovered that the isNull and isNotNull where conditions were not firing correctly due to incorrectly declared constants.

Those constants also suppose to build create the actual SQL query string format. There might not be enough or no tests covering them. The ezFunctionsTest.php does not actually touch any database.

Seems the Windows Github Actions Ci needs fixing now.

It failed the test when I left the $y value lowercase because it was doing an assertive array check in the test files, so I made them uppercase to match the values defined in the constants. I've been trying to work out for weeks why the NULL conditions weren't working but I only actually looked into it last night because I needed it for a query to run properly.

dpDesignz avatar Feb 07 '22 21:02 dpDesignz

It failed the test when I left the $y value lowercase because it was doing an assertive array check in the test files, so I made them uppercase to match the values defined in the constants. I've been trying to work out for weeks why the NULL conditions weren't working but I only actually looked into it last night because I needed it for a query to run properly.

After looking a little further, there are other issues as mentioned, seems the need for more coverage tests should be done too.

Plus test under PHP 8.1 for compatibility, this part I been wanting to do for over 2 months now. Just not in the right mind to address issues, got many other things I'm working on.

TheTechsTech avatar Feb 08 '22 02:02 TheTechsTech

The naming of the constants and meaning actually represent contents without spacing.

Seems there might be some logic bugs elsewhere that should be looked at too. see

https://github.com/ezSQL/ezsql/blob/4bc6a254b7ac9d4856da343682c9af14cbec8909/lib/ezQuery.php#L334 and

https://github.com/ezSQL/ezsql/blob/4bc6a254b7ac9d4856da343682c9af14cbec8909/lib/ezQuery.php#L386

This construction will actually produced IS NOT NULL null the $y = 'null' not really needed.

Yea I had originally tried removing this as well but it wouldn't parse without those values so that's why I used the solution that I have as that does parse with no issues.

Unfortunately, I'm in the same space as you otherwise I would have sorted this earlier myself.

dpDesignz avatar Feb 08 '22 03:02 dpDesignz