Comments (3)
Hi @joanney1,
Thanks for using the document feature!
I tried your test case but couldn't reproduce the problem you had. The query works fine for me. Please feel free to let us know if you have additional questions.
mysql> select id, doc.name from tt where doc.address.zipcode like '98761';
+-----+--------------+
| id | `doc`.`name` |
+-----+--------------+
| 100 | Tom |
+-----+--------------+
1 row in set (0.00 sec)
mysql> select * from tt;
+-----+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | doc |
+-----+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 100 | {"name":"Tom","age":30,"married":false,"address":{"houseNumber":1001,"streetName":"main","zipcode":"98761","state":"CA"},"cars":["F150","Honda"],"memo":null} |
+-----+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select doc.name from tt;
+--------------+
| `doc`.`name` |
+--------------+
| Tom |
+--------------+
1 row in set (0.00 sec)
mysql> select doc.address.zipcode from tt;
+---------------------------+
| `doc`.`address`.`zipcode` |
+---------------------------+
| 98761 |
+---------------------------+
1 row in set (0.00 sec)
from mysql-5.6.
My Test is very simple
Download current zip file.
unzip source file.
cmake without options
make
make install
./scripts/mysql_install_db
./bin/mysqld_safe --user=mysql
Connecting mysql client tool.
mysql> show variables like '%doc%';
+---------------------+-------+
| Variable_name | Value |
+---------------------+-------+
| allow_document_type | ON |
+---------------------+-------+
1 row in set (0.00 sec)
mysql> use test;
Database changed
mysql> create table t( id int not null, doc document not null, primary key (id), unique key id_doc (id, doc.address.zipcode as int))engine=innodb;
Query OK, 0 rows affected (0.02 sec)
mysql> insert into t values ( 1, '{"name":"tom","age":30}');
Query OK, 1 row affected (0.00 sec)
mysql> select doc.name from t;
+--------------+
| doc
.name
|
+--------------+
| NULL |
+--------------+
1 row in set (0.00 sec)
Did I compile something wrong?
Did I install mysql something wrong?
And
Did I change system variables's value something wrong?
I don't know what I did something wrong.
from mysql-5.6.
Hi @joanney1,
Sorry for the delay in replying. I am not clear why you hit this problem. I tried the same queries and still couldn't reproduce - all queries work for me.
We have many more test cases using document paths including some queries similar to yours, covered in our test file: http://github.com/facebook/mysql-5.6/blob/webscalesql-5.6.24.97/mysql-test/suite/json/t/type_document_path.test. Please take a look at the test file and try to run our test cases to see they work for you.
from mysql-5.6.
Related Issues (20)
- Make compilation faster HOT 1
- How to achieve ~20% replication throughput improvement using Read Free Replication (RFR) feature
- Keep long-running MyRocks mtr tests in their own suite HOT 1
- MyRocks 8.0.28 has poor performance of primary key range query HOT 1
- create secondary index needs attention
- issue while install HOT 1
- Error during create secondary index
- Update the Build Steps page HOT 1
- MyRocks engine should respect WITH_UNIT_TESTS
- Allow users to manually set the number of block cache shards HOT 1
- Provide a counter to show pending compaction bytes for RocksDB
- MyRocks does commit step non-durably under server group 2PC protocol HOT 1
- alter talbe add index optimization
- Range lock support HOT 2
- Cached RocksDB transaction object accessed after delete by XA COMMIT
- optimize table has no effect on HIDDEN_PK table
- Rdb_iterator_base::next_with_direction: too many compares for eof check HOT 2
- Determin secondary index value emptiness by datadic
- undefined reference to `sgemm_' When compiling vector DB
- -DWITH_LZ4=system doesn't find the lz4 library on the fb-mysql-8.0.28 branch
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mysql-5.6.