If you're really talking about MySQL as your question is tagged, you're using the entirely wrong methods. STGeomFromText is an SQL Server function.
The MySQL query that does what you want is as simple as;
SELECT *
FROM test1
WHERE MBRContains(GeomFromText('Polygon((0 0,0 4,4 4,4 0,0 0))'), data4)
Just as a bonus, here is how to write it for SQL Server;
SELECT *
FROM test1
WHERE geometry::STGeomFromText('Polygon((0 0,0 4,4 4,4 0,0 0))',0)
.STContains(data4) = 1