-
Notifications
You must be signed in to change notification settings - Fork 131
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
cache is created but unable to query data #1247
Comments
Please highlight if I've left anything out |
Hi @santhoshstalin , Thanks for raising this issue. I can confirm I can reproduce it. We will start investigating it. |
thanks , pfb more info: Instance info: AWS RDS MySQL (8.0.35 Source distribution) mysql> select count() from sbtest1; mysql> show create table sbtest1; mysql> select k from sbtest1 where c="63898592995-24128622894-65843699462-08660435971-77519216553-68029124508-89851108208-50959617462-51765555050-53840398311"; === Using the caching layer: Server version: 8.0.26-readyset Source distribution mysql> select k from sbtest1 where c="63898592995-24128622894-65843699462-08660435971-77519216553-68029124508-89851108208-50959617462-51765555050-53840398311"; mysql> show proxied queries; mysql> create cache from q_5416b1e51211f8a; mysql> On creating the cache the data retrieval is not happening. the reverse -- searching for int value using char works fine mysql> mysql> mysql> create cache from q_2df945b4c14f7d8f; mysql> select c from sbtest1 where k=430614; mysql> ==== mysql> show caches; ==== on dropping the cache the value is retrieved. Same is tested for a smaller table with 2 records as well mysql> show caches; mysql> mysql> mysql> show caches; mysql> select k from sbtest1 where c="63898592995-24128622894-65843699462-08660435971-77519216553-68029124508-89851108208-50959617462-51765555050-53840398311"; |
Check the log, the output (SQL: Create INDEX k_2 ON sbtest2(k)) fix: trigger Change in DDL requires partial resnapshot |
An update on this issue. The problem is caused by CHAR fields which require padding if the row value does not fill the column width. For example:
Currently we don't have a proper way to identify how many spaces we need to pad when saving this data to disk. |
This commits adds proper collation support for CHAR and BINARY columns in MySQL. CHAR columns should be right padded with spaces to the column length when storing them and BINARY should right pad zeros. This commit fixes the issue at snapshot - During snapshot we do a logical dump of data. MySQL removes padding spaces from CHAR columns when retrieving them. So, we need to take the column collation into consideration when storing them. One gotcha is with ENUM/SET columns, they are retrieved as Strings(MYSQL_TYPE_STRING), but we should not pad them. During CDC, we need to retrieve proper metadata from TME in order to validate if padding is necessary or not. This commit also fixes an issue when storing BINARY columns. We were storing them as TinyText/Text if the binary representation of the columns was a valid UTF-8 string. This is not correct. We should store them as ByteArray. Test cases were written taking into consideration a mix of characters from different bytes, like mixing ASCII and UTF-8 characters from 2nd and 3rd bytes. Note: MySQL uses the terminology of charset and collation interchangeably. In the end everything is stored as collation ID, which can be used to determine the charset and collation. Ref: REA-4366 Ref: REA-4383 Closes: #1247 #1259 Release-Note-Core: Added collation support for storing CHAR and BINARY columns in MySQL is correct padding. This fixes and issue when looking up CHAR/BINARY columns with values that do not match the column length. Change-Id: Ibb436b99b46500f940efe79d06d86494bfc4bf30
This commits adds proper collation support for CHAR and BINARY columns in MySQL. CHAR columns should be right padded with spaces to the column length when storing them and BINARY should right pad zeros. This commit fixes the issue at snapshot - During snapshot we do a logical dump of data. MySQL removes padding spaces from CHAR columns when retrieving them. So, we need to take the column collation into consideration when storing them. One gotcha is with ENUM/SET columns, they are retrieved as Strings(MYSQL_TYPE_STRING), but we should not pad them. During CDC, we need to retrieve proper metadata from TME in order to validate if padding is necessary or not. This commit also fixes an issue when storing BINARY columns. We were storing them as TinyText/Text if the binary representation of the columns was a valid UTF-8 string. This is not correct. We should store them as ByteArray. Test cases were written taking into consideration a mix of characters from different bytes, like mixing ASCII and UTF-8 characters from 2nd and 3rd bytes. Note: MySQL uses the terminology of charset and collation interchangeably. In the end everything is stored as collation ID, which can be used to determine the charset and collation. Ref: REA-4366 Ref: REA-4383 Closes: #1247 #1259 Release-Note-Core: Added collation support for storing CHAR and BINARY columns in MySQL using the correct padding. This fixes an issue when looking up CHAR/BINARY columns with values that do not match the column length. Change-Id: Ibb436b99b46500f940efe79d06d86494bfc4bf30
This commits adds proper collation support for CHAR and BINARY columns in MySQL. CHAR columns should be right padded with spaces to the column length when storing them and BINARY should right pad zeros. This commit fixes the issue at snapshot - During snapshot we do a logical dump of data. MySQL removes padding spaces from CHAR columns when retrieving them. So, we need to take the column collation into consideration when storing them. One gotcha is with ENUM/SET columns, they are retrieved as Strings(MYSQL_TYPE_STRING), but we should not pad them. During CDC, we need to retrieve proper metadata from TME in order to validate if padding is necessary or not. This commit also fixes an issue when storing BINARY columns. We were storing them as TinyText/Text if the binary representation of the columns was a valid UTF-8 string. This is not correct. We should store them as ByteArray. Test cases were written taking into consideration a mix of characters from different bytes, like mixing ASCII and UTF-8 characters from 2nd and 3rd bytes. Note: MySQL uses the terminology of charset and collation interchangeably. In the end everything is stored as collation ID, which can be used to determine the charset and collation. Ref: REA-4366 Ref: REA-4383 Closes: #1247 #1259 Release-Note-Core: Added collation support for storing CHAR and BINARY columns in MySQL using the correct padding. This fixes an issue when looking up CHAR/BINARY columns with values that do not match the column length. Change-Id: Ibb436b99b46500f940efe79d06d86494bfc4bf30
This commits adds proper collation support for CHAR and BINARY columns in MySQL. CHAR columns should be right padded with spaces to the column length when storing them and BINARY should right pad zeros. This commit fixes the issue at snapshot - During snapshot we do a logical dump of data. MySQL removes padding spaces from CHAR columns when retrieving them. So, we need to take the column collation into consideration when storing them. One gotcha is with ENUM/SET columns, they are retrieved as Strings(MYSQL_TYPE_STRING), but we should not pad them. During CDC, we need to retrieve proper metadata from TME in order to validate if padding is necessary or not. This commit also fixes an issue when storing BINARY columns. We were storing them as TinyText/Text if the binary representation of the columns was a valid UTF-8 string. This is not correct. We should store them as ByteArray. Test cases were written taking into consideration a mix of characters from different bytes, like mixing ASCII and UTF-8 characters from 2nd and 3rd bytes. Note: MySQL uses the terminology of charset and collation interchangeably. In the end everything is stored as collation ID, which can be used to determine the charset and collation. Ref: REA-4366 Ref: REA-4383 Closes: #1247 #1259 Release-Note-Core: Added collation support for storing CHAR and BINARY columns in MySQL using the correct padding. This fixes an issue when looking up CHAR/BINARY columns with values that do not match the column length. Change-Id: Ibb436b99b46500f940efe79d06d86494bfc4bf30
This commits adds proper collation support for CHAR and BINARY columns in MySQL. CHAR columns should be right padded with spaces to the column length when storing them and BINARY should right pad zeros. This commit fixes the issue at snapshot - During snapshot we do a logical dump of data. MySQL removes padding spaces from CHAR columns when retrieving them. So, we need to take the column collation into consideration when storing them. One gotcha is with ENUM/SET columns, they are retrieved as Strings(MYSQL_TYPE_STRING), but we should not pad them. During CDC, we need to retrieve proper metadata from TME in order to validate if padding is necessary or not. This commit also fixes an issue when storing BINARY columns. We were storing them as TinyText/Text if the binary representation of the columns was a valid UTF-8 string. This is not correct. We should store them as ByteArray. Test cases were written taking into consideration a mix of characters from different bytes, like mixing ASCII and UTF-8 characters from 2nd and 3rd bytes. Note: MySQL uses the terminology of charset and collation interchangeably. In the end everything is stored as collation ID, which can be used to determine the charset and collation. Ref: REA-4366 Ref: REA-4383 Closes: #1247 #1259 Release-Note-Core: Added collation support for storing CHAR and BINARY columns in MySQL using the correct padding. This fixes an issue when looking up CHAR/BINARY columns with values that do not match the column length. Change-Id: Ibb436b99b46500f940efe79d06d86494bfc4bf30
this is interesting, while testing readyset with sbtest table found that the proxied queries shows supported but after creation of cache the data is not visible
tried in small table second time and same behavior is seen
the datatype in where condition is char
mysql> drop cache q_a84848222487ada9;
Query OK, 1 row affected (0.01 sec)
mysql> select count() from sbtest2 where c="17683594789-79094539502-64837025634-64401068468-93240347875-80207879399-06064830238-97247190956-35331442429-27373799568";
+----------+
| count() |
+----------+
| 1 |
+----------+
1 row in set (0.00 sec)
mysql> create cache from q_a84848222487ada9;
Query OK, 0 rows affected (0.01 sec)
mysql> select count() from sbtest2 where c="17683594789-79094539502-64837025634-64401068468-93240347875-80207879399-06064830238-97247190956-35331442429-27373799568";
+----------+
| count() |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
mysql> show create table sbtest2;
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| sbtest2 | CREATE TABLE
sbtest2
(id
int NOT NULL AUTO_INCREMENT,k
int NOT NULL DEFAULT '0',c
char(120) NOT NULL DEFAULT '',pad
char(60) NOT NULL DEFAULT '',PRIMARY KEY (
id
),KEY
k_2
(k
)) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
The text was updated successfully, but these errors were encountered: