Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issues with spatial fields #14125

Merged
merged 3 commits into from May 12, 2018
Merged

Fix for issues with spatial fields #14125

merged 3 commits into from May 12, 2018

Conversation

aroralakshya
Copy link
Contributor

@aroralakshya aroralakshya commented Mar 26, 2018

Fixes the following issues:

  1. Fixes SPATIAL fields with no unique index/autoincrement error when clicking #14068 SPATIAL fields with no unique index/autoincrement error when clicking
    This error occurs when there is no unique column to uniquely identify a tuple. I've disabled the geomtery view and made view as wkt the default view in such cases.
  2. Fixes View spatial fields as WKT doesn't work  #14121 View spatial fields as WKT doesn't work
  3. Fixes IS NULL search operator produces no WHERE SQL with spatial fields #14067 IS NULL search operator produces no WHERE SQL with spatial fields
    Signed-Off-By: Lakshya arora arora.lakshya123@gmail.com

Before submitting pull request, please check that every commit:

  • Has proper Signed-Off-By
  • Has commit message which describes it
  • Is needed on it's own, if you have just minor fixes to previous commits, you can squash them
  • Any new functionality is covered by tests

@codecov
Copy link

codecov bot commented Mar 28, 2018

Codecov Report

Merging #14125 into master will increase coverage by 2.54%.
The diff coverage is 10%.

@@             Coverage Diff              @@
##             master   #14125      +/-   ##
============================================
+ Coverage     52.89%   55.43%   +2.54%     
- Complexity    14351    14378      +27     
============================================
  Files           492      494       +2     
  Lines         63665    70621    +6956     
============================================
+ Hits          33676    39150    +5474     
- Misses        29989    31471    +1482

@aroralakshya
Copy link
Contributor Author

How to add test cases to improve coverage??

@MauricioFauth
Copy link
Member

Hello, @nulll-pointer. Thanks for your contribution!
Each class has its own unit test class. These classes are found in the test/classes/ directory.
Run the vendor/bin/phpunit command to test.

Fixes the following issues:

1.    #14068 SPATIAL fields with no unique index/autoincrement error when clicking
      This error occurs when there is no unique column to uniquely identify a tuple. I've disabled the geomtery view and made view as wkt the default view in such cases.

2.    #14121 View spatial fields as WKT doesn't work

1.    #14067 IS NULL search operator produces no WHERE SQL with spatial fields

Signed-Off-By: Lakshay arora <arora.lakshya123@gmail.com>
@aroralakshya
Copy link
Contributor Author

Hello @MauricioFauth, I've made some small changes in the unit test cases. Kindly have a look.

'hide_transformation' => $_SESSION['tmpval']['hide_transformation'],
'display_blob' => $_SESSION['tmpval']['display_blob'],
'display_binary' => $_SESSION['tmpval']['display_binary'],
'relational_display' => $_SESSION['tmpval']['relational_display'],
'displaywork' => $GLOBALS['cfgRelation']['displaywork'],
'relwork' => $GLOBALS['cfgRelation']['relwork'],
'possible_as_geometry' => $_SESSION['tmpval']['possible_as_geomtery'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks wrong. Are you sure it's correct?

This commit fixes view as BINARY not working in the previous commit.
Signed-Off-By: Lakshay arora <arora.lakshya123@gmail.com>
@@ -1687,6 +1692,7 @@ private function _getOptionsBlock()
'relational_display' => $_SESSION['tmpval']['relational_display'],
'displaywork' => $GLOBALS['cfgRelation']['displaywork'],
'relwork' => $GLOBALS['cfgRelation']['relwork'],
'possible_as_geometry' => $_SESSION['tmpval']['possible_as_geomtery'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's still a typo in possible_as_geomtery.

Fixes typo in previous commits.

Signed-Off-By: Lakshay arora <arora.lakshya123@gmail.com>
@MauricioFauth MauricioFauth merged commit 9231620 into phpmyadmin:master May 12, 2018
@MauricioFauth MauricioFauth self-assigned this May 12, 2018
@MauricioFauth
Copy link
Member

Merged, thanks for your contribution!

MauricioFauth pushed a commit that referenced this pull request May 12, 2018
*  Fix for issues with spatial fields

Fixes the following issues:

1.    #14068 SPATIAL fields with no unique index/autoincrement error when clicking
      This error occurs when there is no unique column to uniquely identify a tuple. I've disabled the geomtery view and made view as wkt the default view in such cases.

2.    #14121 View spatial fields as WKT doesn't work

1.    #14067 IS NULL search operator produces no WHERE SQL with spatial fields

Signed-Off-By: Lakshay arora <arora.lakshya123@gmail.com>

* Fix for issues with spatial fields
This commit fixes view as BINARY not working in the previous commit.
Signed-Off-By: Lakshay arora <arora.lakshya123@gmail.com>

* Fix for issues with spatial fields

Fixes typo in previous commits.

Signed-Off-By: Lakshay arora <arora.lakshya123@gmail.com>
(cherry picked from commit 9231620)
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
MauricioFauth added a commit that referenced this pull request May 12, 2018
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
@MauricioFauth MauricioFauth added this to the 4.8.1 milestone May 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants