Explanation of 10 MySQL Error injection principles (II.)

Source: Internet
Author: User

In a previous article, three kinds of MySQL error injection principle. I will continue to explain below.

1, GeometryCollection ()

Select *  from where id=1 and GeometryCollection ((select*from ( Select *  from (Selectuser()) a) (b));

Function Explanation:

GeometryCollection is a geometric object consisting of one or more arbitrary class geometries. All elements in the geometrycollection must have the same spatial reference system (that is, the same coordinate system). There are no restrictions on the elements of GeometryCollection, but the subclasses of the geometrycollection described below limit their members. This type of restriction may be based on:

The element type (for example, multipoint may contain only the point element).

The number of dimensions.

Limit the degree of overlap in space between elements.

(The above function explanation is excerpted from the official documentation.)

Say so official, feel is actually "drawing tool", 2.1 line, 4.1 side, 8.1 body .... Personal understanding feels like that.

Examples in official documentation are as follows:

GeometryCollection (Pointten), point (15), LINESTRING (  ))

Point (x, y) function, this thing is coordinates. A chestnut ~ is equivalent to a point on the x, Y coordinate chart.

LINESTRING (x y,x y) function, which is used to describe a straight line, a line of two points.

Principle Analysis:

We attack load split, query for a string of characters, and then use processing geometrycollection (), because MySQL can not use such a string to draw graphics, so error.

Select User ()Select*from(...) Aselect*from(...) bSelect*fromwhere id=1 and GeometryCollection ((...));

2, Multipoint ()

Select *  from where id=1 and Multipoint ((select*from (Select  *from (selectuser()) a) (b));

Function Explanation:

Multipoint is a collection of geometric objects that are composed of point elements. These points are not connected or sorted in any way.

MultiPoint Example

On the world map, multipoint can represent the island chain.

On the city map, multipoint can represent the exit of the ticket office.

MultiPoint Properties

Multipoint is a 0-D geometric object.

If no two point is the same (with an equivalent coordinate value), the multipoint is simple.

The multipoint boundary is an empty collection.

(The above explanation reveals the thick official taste, it is the official explanation indeed)

This explanation, I see the foggy, no matter how comprehensive and abstract the interpretation. The MultiPoint () function must be a number!

Principle Analysis:

Because you need numbers, that's fine. GeometryCollection's routine, ok!. Stability error.

3, Polygon ()

Select *  from where id=1 and Polygon ((select*from (Select  *from (selectuser()) a) (b));

Function Explanation: 

Polygon is a planar surface that represents a multi-dimensional geometric object. It is defined by a single outer boundary and 0 or more internal boundaries, where each inner boundary is defined as 1 holes in polygon.

Polygon Example

On a regional map, polygon objects can represent forests, zones, and so on.

Polygon Statement

The boundary of a polygon consists of a set of linearring-to-turn sets that make up its outer boundaries and are more than the inner boundary (that is, simple and closed linestring objects).

The polygon has no intersecting rings. Rings in the polygon boundary may intersect at point, but intersect only in tangent mode.

Polygon no lines, spikes or perforations.

The polygon has an interior consisting of a collection of connection points.

Polygon may contain holes. For polygon with holes, the outside is not connected. Each hole defines the external part of the connection.

The aforementioned declaration makes polygon a simple geometric object.

(Sorry, this piece I have to continue to use the official explanation,)

Explanation of principle:

Polygon () The goods are very difficult to explain, space geometry is always a more abstract one. Divide the geometry into areas, and connect and intersect (as the individual understands). As long as you know that this function is also required numbers, probably can be an error, such a concept.

Space geometry, very abstract, difficult to understand. Attach the official documentation.

Http://www.mysqlab.net/docs/view/refman-5.1-zh/chapter/spatial-extensions-in-mysql.html

This time here, remember to pay attention.

Explanation of 10 MySQL Error injection principles (II.)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.