You said that you set your field via a mysql query. When you use characteristics for a product, hikashop will create automatically a variant per combination of thes values of the characteristics. That allows you to set specific information for some values like for example to change the price.
These variants are also saved in the product table. Also, when you have a product with a variant, if there is data in the variant field, the variant field is used instead of the main product field.
So I suppose that all the variants of your product have the field with Y. Which means that whatever the value of the main product, the value of the variant displayed will be used.
It's the normal behaviour.
The problem is your query. You should only set your field when the value "main" is in the "product_type" field of the product table.