I am not sure what is the correct behavior here. The polygon consists of two separate parts (see the picture).
Here http://support.esri.com/en/knowledgebase/GISDictionary/term/polygon I see two definitions of 'polygon':
[data models] On a map, a closed shape defined by a connected sequence of x,y coordinate pairs, where the first and last coordinate pair are the same and all other pairs are unique.
[ESRI software] In ArcGIS software, a shape defined by one or more rings, where a ring is a path that starts and ends at the same point. If a polygon has more than one ring, the rings may be separate from one another or they may nest inside one another, but they may not overlap.
The polygon in question fits the second definition. Also, PostGIS which is rather strict about misuse of different shapes, agrees to create it as a polygon.
But both PostGIS and MariaDB return ST_NumInteriorRings = 1 for it. I don't know why, obviously there are no interior rings in here. I could not however find a clear definition of how ST_NumInteriorRings should behave in this case.