Giter VIP home page Giter VIP logo

radondb / radon Goto Github PK

View Code? Open in Web Editor NEW
1.8K 90.0 217.0 5.61 MB

RadonDB is an open source, cloud-native MySQL database for building global, scalable cloud services

Home Page: https://radondb.io/

License: GNU General Public License v3.0

Makefile 0.15% Go 99.76% Shell 0.09%
go sql database distributed-database radondb full-text-search distributed-transaction json transaction cloud-native-database

radon's Introduction

Build Status Go Report Card codecov.io

OverView

RadonDB is an open source, Cloud-native MySQL database for unlimited scalability and performance.

What is RadonDB?

RadonDB is a cloud-native database based on MySQL, and architected in fully distributed cluster that enable unlimited scalability (scale-out), capacity and performance. It supported distributed transaction that ensure high data consistency, and leveraged MySQL as storage engine for trusted data reliability. RadonDB is compatible with MySQL protocol, and sup-porting automatic table sharding as well as batch of automation feature for simplifying the maintenance and operation workflow.

Features

  • Automatic Sharding
  • Auditing and Logging
  • Parallel Execution: Parallel Query, Parallel DML and Parallel DDL
  • Parallel CHECKSUM TABLE: Gives same results as MySQL
  • Distributed Transaction: Snapshot Isolation
  • Distributed Joins: Sort-Merge Join, Nested-Loop Join
  • Distributed Full Text Search
  • Multi Tenant by Database
  • Prepared SQL Statement
  • JSON

Documentation

For guidance on installation, deployment, and administration, see our Documentation.

Architecture

Overview

RadonDB is a new generation of distributed relational database (MyNewSQL) based on MySQL. It was designed to create the open-source database our developers would want to use: one that has features such as financial high availability、 large-capacity database、automatic plane split table、 scalable and strong consistency, this guide sets out to detail the inner-workings of the radon process as a means of explanation.

SQL Layer

SQL support

On SQL syntax level, RadonDB Fully compatible with MySQL.You can view all of the SQL features RadonDB supports here radon_sql_statements_manual

SQL parser, planner, executor

After your SQL node receives a SQL request from a mysql client via proxy, RadonDB parses the statement, creates a query plan, and then executes the plan.

                                                                +---------------+
                                                    x---------->|node1_Executor |
                            +--------------------+  x           +---------------+
                            |      SQL Node      |  x
                            |--------------------|  x
+-------------+             |     sqlparser      |  x           +---------------+
|    query    |+----------->|                    |--x---------->|node2_Executor |
+-------------+             |  Distributed Plan  |  x           +---------------+
                            |                    |  x
                            +--------------------+  x
                                                    x           +---------------+
                                                    x---------->|node3_Executor |
                                                                +---------------+

Parsing

Received queries are parsed by sqlparser (which describes the supported syntax by mysql) and generated Abstract Syntax Trees (AST).

Planning

With the AST, RadonDB begins planning the query's execution by generating a tree of planNodes. This step also includes steps analyzing the client's SQL statements against the expected AST expressions, which include things like type checking.

You can see the a query plan generates using EXPLAIN(At this stage we only use EXPLAIN to analysis Table distribution).

Excuting

Executing an Executor in a storage layer in Parallel with a Distributed Execution Plan.

SQL with Transaction

The SQL node is stateless, but in order to guarantee transaction Snapshot Isolation, it is currently a write-multiple-read mode.

Transaction Layer

Distributed transaction

RadonDB provides distributed transaction capabilities. If the distributed executor at different storage nodes and one of the nodes failed to execute, then operation of the rest nodes will be rolled back, This guarantees the atomicity of operating across nodes and makes the database in a consistent state.

Isolation Levels

RadonDB achieves the level of SI (Snapshot Isolation) at the level of consistency. As long as a distributed transaction has not commit, or if some of the partitions have committed, the operation is invisible to other transactions.

Transaction with SQL Layer

The SQL node is stateless, but in order to guarantee transaction Snapshot Isolation, it is currently a write-multiple-read mode.

Issues

The integrated github issue tracker is used for this project.

License

RadonDB is released under the GPLv3. See LICENSE

radon's People

Contributors

andyli029 avatar arstercz avatar bohutang avatar dbkernel avatar hustjieke avatar ldsink avatar lijiangsheng1 avatar osguydch avatar zhyass avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

radon's Issues

[bug] count() report info error

In mysql, count() will return syntax err

mysql> select count() from tb1; 
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') from tb1' at line 1

In radon the return info is:

mysql>  select count() from tb3;
ERROR 2013 (HY000): Lost connection to MySQL server during query

The error occur at radon/src/planner/expr.go:141 when get ex.Exprs[0] not exists, then report runtime error: index out of range.

radon insert problem

  1. execute this sql on backend mysql-server with no error
    but execute on radon-db-server ,it does not work!
    my english is not so good, did i make myself clear?

mysql> insert into pk_card_enter(cid,id,ltd_code,park_code,mac_code,card_id,type,car_no,acc_time,enter_type,status,action_time,video_no,create_date,door_name,upseason,reader_addr,feeseason,in_car_type,operator,park_name,card_type,in_time,leave_time,is_handset,is_img,phone_in_password,phone_no,file_path,is_hardware,is_csmain,is_subparking,sub_parking,card_car_no,eq_card_no,is_effective,card_sn_id,is_carno_matching,liquidating_code,liquidating_mark,standar_acc_time,up_time) values(111147361,'7bc0087d-0bb5-4cce-81b8-bb9187f9ab19','0001','00010001','000100010001','12816503',2,'粤AS885P','2016-12-01 08:21:30',1,1,'2016-12-01 08:21:30','00010001D0001','2016-12-01 08:21:13','车场入口','2','1','','','刘风连','三寓宾馆停车场','月租卡','2016-12-01 08:21:30',NULL,0,1,NULL,'','20161201/08/2016120108213012816503.jpg',0,1,0,NULL,'粤AS885P',NULL,NULL,'',1,NULL,0,'2016-12-01 08:21:11','2016-12-19 18:36:19');

ERROR 1149 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use, syntax error at position 108 near 'status'
mysql>

[feature] add global table to support the distributed join

Summary

Create two tables tb1 and tb2, such as:

CREATE TABLE `tb1` (
 `a` int, 
 `b` varchar(255),  
 PRIMARY KEY  (`a`)
)ENGINE=InnoDB  DEFAULT CHARSET=utf8;

CREATE TABLE `tb2` (
 `c` int, 
 `d` char,  
 PRIMARY KEY  (`c`)
)ENGINE=InnoDB  DEFAULT CHARSET=utf8
 PARTITION BY HASH(`c`);

Without partition by hash, tb1 will be a global table (or broadcast table). The global table has full data at ervery backend, it can support the join with a partition table. Such as:

SELECT tb1.a,tb1.b FROM tb1 JOIN tb2 ON tb1.a=tb2.c WHERE tb2.d='NanJing'

The sql can be distributed to the backends. The datas from the backends gather on the radon.

The global tables are generally used for tables with fewer changes and smaller capacity, requiring frequent association with other tables.

where is install guides?

Thank you for your open source this great product, but I can't find some docs about how to install radon.

don't support jdbc transaction?

i try insert 100 record. use transaction.
sqlconnection close function, catch error.

error:
java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use, syntax error at position 9 near 'rollback'

radon如何支持外部访问?

  1. 参考文档,rest-api的确可以实现给后端MySQL添加本地用户,但radon只能在本机访问
    报错如下:
    2018/05/15 17:17:45.892306 auth.go:139: [ERROR] proxy: auth.user[root].failed(password.invalid):want[[89 223 240 70 44 7 2 202 154 74 149 248 53 42 238 70 192 194 109 206]]!=got[[77 34 129 174 3 224 34 45 152 251 202 58 202 169 175 254 225 178 11 148]]
    2018/05/15 17:17:45.892361 server.go:153: [WARNING] server.user[root].auth.check.failed

Not able to create database with encoding / collation options

Hi,

I have just tried with radondb, it worked fine with the normal database creation but not for extra options. See below:

mysql> create database test1;
Query OK, 1 row affected (0.00 sec)

mysql>  create database test1 character set utf8 collate utf8_general_ci;
ERROR 1149 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use, syntax error at position 32 near 'character'`

RadonDB's output log:

2018/05/16 10:09:09.701490 query.go:63:    	 [ERROR] 	query[create database test1 character set utf8 collate utf8_general_ci].parser.error: syntax error at position 32 near 'character'
2018/05/16 10:09:09.701532 server.go:204:    	 [ERROR] 	server.handle.query.from.session[2].error:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use, syntax error at position 32 near 'character' (errno 1149) (sqlstate 42000).query[create database test1 character set utf8 collate utf8_general_ci]

This command works fine on normal mysql instance. What can be a problem?

build successfully with fatal error: No names found, cannot describe anything.

$ make build
fatal: No names found, cannot describe anything.
fatal: No names found, cannot describe anything.
--> Building...
go build -v -o bin/xenon --ldflags '-X "build.tag=" -X "build.time=2018/05/11 12:18:19" -X "build.git=658d7f1"' src/xenon/xenon.go

Fedora 28 x86_64 w/ go version go1.10.1 linux/amd64

How radonDB implement Snapshot Isolation

Is there some design doc for implementation of Snapshot Isolation ?

Queue commit action?

// CommitLock used to acquire the commit.
func (mgr *TxnManager) CommitLock() {
	mgr.commitLock.Lock()
}

Error: Table 'information_schema.SCHEMATA' doesn't exist (errno 1146) (sqlstate 42S02)

Xenon cluster

mysql -uroot -h168.5.80.102 -P3306 -p123456
It's OK

Single-node radon

Add backend1 Xenon cluster

curl -i -H 'Content-Type: application/json' -X POST -d '{"name": "backend1", "address": "168.5.80.102:3306", "user":"root", "password": "123456", "max-connections":1024}' http://127.0.0.1:8080/v1/radon/backend

add user

curl -i -H 'Content-Type: application/json' -X POST -d '{"user": "radon", "password": "radon"}' http://127.0.0.1:8080/v1/user/add

add allowIP

curl -i -H 'Content-Type: application/json' -X PUT -d '{"allowip":["my client ip"]}' http://127.0.0.1:8080/v1/radon/config

Mysql Client

mysql -uradon -h168.5.80.92 -P3308 -pradon
It's OK.
when i use navicat connect to the db,The error has appeared

 2018/08/31 16:02:58.868561 router.go:163:       [ERROR]      
 router.can.not.find.db[information_schema]
 2018/08/31 16:02:58.868606 query.go:225:        [ERROR]
 proxy.select[SELECT SCHEMA_NAME, DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA].from.session[8].error:Table 'information_schema.SCHEMATA' doesn't exist (errno 1146) (sqlstate 42S02)
 2018/08/31 16:02:58.868628 server.go:204:       [ERROR]        
 server.handle.query.from.session[8].error:Table 'information_schema.SCHEMATA' doesn't exist (errno 1146) (sqlstate 42S02).query[SELECT SCHEMA_NAME, DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA]

And
mysql> use information_schema;
ERROR 1227 (42000): Access denied; lacking privileges for database information_schema

I am confused with it :)

[bug] insert statement too long report error

2018/11/29 20:02:20.251914 query.go:167:    	 [ERROR] 	proxy.insert[INSERT INTO ontime.ontime ( Year, Quarter, Month, DayofMonth, DayOfWeek, FlightDate, UniqueCarrier, AirlineID, Carrier, TailNum, FlightNum, OriginAirportID, OriginAirportSeqID, OriginCityMarketID, Origin, OriginCityName, OriginState, OriginStateFips, Origi ... [TRUNCATED]].from.session[819].error:write tcp 172.16.0.20:59930->172.16.0.242:3306: write: broken pipe

Improve code coverage

To improve code reliability, the code coverage of every file in radon should not be less than 95 percent!

make lint error

make lint

#go get -u golang.org/x/tools/cmd/golint
golint src src/monitor src/proxy src/proxy/xacheck src/optimizer src/config src/planner src/backend src/backend/radon-meta src/cli src/cli/cmd src/cli/cmd/xacheck src/xcontext src/xbase src/xbase/sync2 src/xbase/stats src/audit src/radon src/binlog src/executor src/build src/syncer src/ctl src/ctl/v1 src/ctl/v1/xacheck src/fakedb src/vendor src/router
#go get -u -v github.com/golangci/golangci-lint/cmd/golangci-lint
golangci-lint run
ERRO Running error: context loading failed: failed to load program with go/packages: go [list -e -json -compiled -test=true -export=false -deps=true -- ./...]: exit status 1: go build golang.org/x/tools/go/ast/astutil: no Go files in
go build golang.org/x/tools/go/gcexportdata: no Go files in
go build golang.org/x/lint: no Go files in
go build golang.org/x/tools/go/buildutil: no Go files in
go build golang.org/x/tools/go/loader: no Go files in
make: *** [lint] Error 3

[qa] fixup gometalinter and megacheck checks

Summary

makefile have add make check to check the coce via gometalinter&megacheck, it's unhappy with:

 make check 
go get -v gopkg.in/alecthomas/gometalinter.v2
go get -v honnef.co/go/tools/cmd/megacheck
bin/gometalinter.v2 -j 4 --disable-all \
--enable=gofmt \
--enable=golint \
--enable=vet \
--enable=gosimple \
--enable=unconvert \
--deadline=10m xbase ctl/v1/ xcontext config router optimizer planner executor backend proxy audit syncer binlog monitor 2>&1 | tee /dev/stderr
bin/megacheck xbase ctl/v1/ xcontext config router optimizer planner executor backend proxy audit syncer binlog monitor  2>&1 | tee /dev/stderr
src/proxy/query.go:258:6: this value of qr is never used (SA4006)
src/proxy/query.go:258:6: this value of qr is never used (SA4006)
src/backend/xacheck.go:32:2: const xaRedoError is unused (U1000)
src/backend/xacheck.go:33:2: const xaRedoOk is unused (U1000)
src/backend/xacheck.go:32:2: const xaRedoError is unused (U1000)
src/backend/xacheck.go:33:2: const xaRedoOk is unused (U1000)

[feature] pushed-down distributed join support

In addition to joins between global tables or between global tables and shard tables, distributed joins that support push-down can be implemented in the following two cases.

1. Tables participating in JOIN all have shard keys as conditions in filtering conditions,  
the data calculated by shard algorithm is distributed on the same partition。

2. Tables participating in JOIN all use shard keys as JOIN conditions, and have same 
shard partitions。

error from cmd: select @@version_comment limit 1

mysql> select @@version_comment limit 1;
ERROR 1046 (3D000): No database selected

log:
2018/05/30 17:52:57.504176 query.go:209: [ERROR] proxy.select[select @@version_comment limit 1].from.session[2].error:No database selected (errno 1046) (sqlstate 3D000)
2018/05/30 17:52:57.504238 server.go:204: [ERROR] server.handle.query.from.session[2].error:No database selected (errno 1046) (sqlstate 3D000).query[select @@version_comment limit 1]

is similar to cmd: select 1;

[feature] Distributed transaction enhancement

the xa is invalid: insert some values return ok, but some values is not successful when the twopc-enable is true

the client insert some values, run long time and return ok but some values is not successful,
when one backend is lost and some values on the backend node ,at the same time the twopc-enable is true

mysql> insert a(i,j) values(3,3),(7,7);
Query OK, 2 rows affected (2 min 11.95 sec)

the value (3,3) on the backend node1;
the value (7,7) on the backend node2;

When executing the cmd, the backend node2 is lost, the value (7,7) is not successful, but the client which waiting for a long time got the Query OK.

suppress password from output

$ bin/radon -c bin/radon.default.json 
radon:[{Tag: Time:2018/05/22 07:10:59 Git:6c75509 GoVersion:go1.10.1 Platform:linux amd64}]
 2018/05/22 15:19:17.546503 scatter.go:51:    	 [WARNING] 	scatter.add:&{db1 127.0.0.1:3306 root Passw0rd  utf8 100}
 2018/05/22 15:19:17.546696 scatter.go:224:    	 [WARNING] 	scatter.load.backend:&{Name:db1 Address:127.0.0.1:3306 User:root Password:Passw0rd DBName: Charset:utf8 MaxConnections:100}

ERROR: COM_FIELD_LIST.not.implemented

After execute command use db successfully, some error logs appear:

2018/06/06 16:14:55.889670 server.go:212:       [ERROR]    session.command:COM_FIELD_LIST.not.implemented
 2018/06/06 16:14:55.889799 server.go:212:       [ERROR]    session.command:COM_FIELD_LIST.not.implemented
 2018/06/06 16:14:55.889904 server.go:212:       [ERROR]    session.command:COM_FIELD_LIST.not.implemented
 2018/06/06 16:14:55.889996 server.go:212:       [ERROR]    session.command:COM_FIELD_LIST.not.implemented
 2018/06/06 16:14:55.890112 server.go:212:       [ERROR]    session.command:COM_FIELD_LIST.not.implemented
 2018/06/06 16:14:55.890181 server.go:212:       [ERROR]    session.command:COM_FIELD_LIST.not.implemented

[feature]add new sql statement syntax

Summary

surpport DQL like :

  1. table alias : SELECT table_alias.column FROM table AS table_alias
  2. fields alias : SELECT column AS column_alias FROM table
    and
  3. currently radon doesn`t support status like:
    SELECT sessionid,userid,lastaccess FROM sessions WHERE status='1';

提几个建议和问题

1.部署方式建议采用ansible来部署提高部署效率。
2.要有图形化的监控方式。
3.目前是否支持表空间的在线收缩和重平衡。
4.数据倾斜和热点数据的问题如何解决,有没比较好的处理方式。
5.文档需要完善。

how to add a user?

user.go:44 line,why localhost?

query := fmt.Sprintf("GRANT SELECT ON *.* TO '%s'@'localhost' IDENTIFIED BY '%s'", p.User, p.Password)

error log

 2018/05/12 21:10:25.418202 user.go:42:    	 [WARNING] 	api.v1.create.user[from:127.0.0.1:8083].[{root test}]
 2018/05/12 21:10:25.419886 connection.go:198:    	 [ERROR] 	conn[10.0.2.44:3306].execute[GRANT SELECT ON *.* TO 'root'@'localhost' IDENTIFIED BY 'test'].error:Access denied for user 'root'@'10.0.2.40' (using password: YES) (errno 1045) (sqlstate 28000)
 2018/05/12 21:10:25.419924 txn.go:412:    	 [ERROR] 	txn.execute.on[10.0.2.44:3306].query[GRANT SELECT ON *.* TO 'root'@'localhost' IDENTIFIED BY 'test'].error:Access denied for user 'root'@'10.0.2.40' (using password: YES) (errno 1045) (sqlstate 28000)
 2018/05/12 21:10:25.420007 connection.go:198:    	 [ERROR] 	conn[10.0.2.43:3306].execute[GRANT SELECT ON *.* TO 'root'@'localhost' IDENTIFIED BY 'test'].error:Access denied for user 'root'@'10.0.2.40' (using password: YES) (errno 1045) (sqlstate 28000)
 2018/05/12 21:10:25.420033 txn.go:412:    	 [ERROR] 	txn.execute.on[10.0.2.43:3306].query[GRANT SELECT ON *.* TO 'root'@'localhost' IDENTIFIED BY 'test'].error:Access denied for user 'root'@'10.0.2.40' (using password: YES) (errno 1045) (sqlstate 28000)
 2018/05/12 21:10:25.420195 connection.go:198:    	 [ERROR] 	conn[10.0.2.42:3306].execute[GRANT SELECT ON *.* TO 'root'@'localhost' IDENTIFIED BY 'test'].error:Access denied for user 'root'@'10.0.2.40' (using password: YES) (errno 1045) (sqlstate 28000)
 2018/05/12 21:10:25.420215 txn.go:412:    	 [ERROR] 	txn.execute.on[10.0.2.42:3306].query[GRANT SELECT ON *.* TO 'root'@'localhost' IDENTIFIED BY 'test'].error:Access denied for user 'root'@'10.0.2.40' (using password: YES) (errno 1045) (sqlstate 28000)
 2018/05/12 21:10:25.420601 user.go:46:    	 [ERROR] 	api.v1.create.user[{User:root Password:test}].error:Access denied for user 'root'@'10.0.2.40' (using password: YES) (errno 1045) (sqlstate 28000)

Remove hard code http listen port

2018/05/11 20:30:32.971037 admin.go:56: [PANIC] listen tcp :8080: bind: address already in use
panic: [PANIC] listen tcp :8080: bind: address already in use

hard code in radon/src/ctl/admin.go

admin.server = &http.Server{Addr: ":8080", Handler: handlers}

$ cat bin/radon.default.json
{
"proxy": {
"endpoint": ":3308",
"meta-dir": "bin/radon-meta",
"peer-address": "127.0.0.1:9080"
},
"binlog": {
"binlog-dir": "bin/radon-binlog"
},
"audit": {
"audit-dir": "bin/radon-audit"
},
"log": {
"level": "WARNING"
}
}

unsupported: function:DATE_FORMAT

mysql> select DATE_FORMAT(create_date,'%Y%m%d') days,sum(type) as parkfee from pk_card_enter where create_date between '2017-04-22 00:00:00' and '2017-05-23 00:00:00' group by days;
ERROR 1105 (HY000): unsupported: function:DATE_FORMAT
mysql>

compared to vittes

Hi there, I see lot of similarities with vitess from youtube, how is it different ?

[docs] unsupport sql

using report error

mysql> select * from (select * from tb1) as t1 join (select * from tb2) as t2 using(a);
ERROR 1149 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use, syntax error at position 77 near 'using'

subquery report info wrong

mysql> select * from (select * from tb1) as tb1;
ERROR 2013 (HY000): Lost connection to MySQL server during query

having unsupport expr

mysql> select    min(Year), max(Year), Carrier, count(*) as cnt,    sum(ArrDelayMinutes>30) as flights_delayed,    round(sum(ArrDelayMinutes>30)/count(*),2) as rate FROM ontime WHERE    DayOfWeek not in (6,7) and OriginState not in ('AK', 'HI', 'PR', 'VI')    and DestState not in ('AK', 'HI', 'PR', 'VI')    and FlightDate < '2010-01-01' GROUP by Carrier HAVING cnt > 100000 and max(Year) > 1990 ORDER by rate DESC LIMIT 1000;
ERROR 1105 (HY000): unsupported: expr[max(`year`)].in.having.clause

unsupport function

round

mysql> select    min(Year), max(Year), Carrier, count(*) as cnt,    sum(ArrDelayMinutes>30) as flights_delayed,    round(sum(ArrDelayMinutes>30)/count(*),2) as rate FROM ontime WHERE    DayOfWeek not in (6,7) and OriginState not in ('AK', 'HI', 'PR', 'VI')    and DestState not in ('AK', 'HI', 'PR', 'VI')    and FlightDate < '2010-01-01' GROUP by Carrier HAVING cnt > 100000  ORDER by rate DESC LIMIT 1000;     
ERROR 1105 (HY000): unsupported: function:round

unsupport distinct

mysql> SELECT distinct DestCityName, count(OriginCityName) AS u FROM ontime WHERE Year >= 2000 and Year <= 2010 GROUP BY DestCityName ORDER BY u DESC LIMIT 10;
ERROR 1105 (HY000): unsupported: distinct
mysql> SELECT DestCityName, count(distinct OriginCityName) AS u FROM ontime WHERE Year >= 2000 and Year <= 2010 GROUP BY DestCityName ORDER BY u DESC LIMIT 10;         
ERROR 1105 (HY000): unsupported: distinct.in.function:count

unsupport load data infile into table

mysql> load data infile "/data/mysql/e.sql" into table e fields terminated by ',';
ERROR 1149 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use, syntax error at position 5 near 'load'

count() report info wrong

mysql>  select count() from tb3;
ERROR 2013 (HY000): Lost connection to MySQL server during query

where clause with tablename report err when delete shard table

mysql> delete from tb3 where tb3.b='d';
ERROR 1054 (42S22): Unknown column 'tb3.b' in 'where clause'

unsupport join ... using

mysql> select * from tb1 join tb2 using(a,a);
ERROR 1149 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use, syntax error at position 33 near 'using'

make testsyncer failed in mac

make testsyncer failed in mac to the commit id 4b6377e:
in ubuntu just succeed

make testsyncer
go test -v -race syncer

=== RUN TestMetaVersionCheck
2018/08/29 17:27:20.665576 mock.go:83: [PANIC] syncer.mock.check.sha.error:oldsha1[[13 130 71 83 146 111 171 52 28 28 65 71 228 71 235 240 155 188 73 50]],sha1:[[117 72 151 60 187 148 53 147 163 224 218 32 226 176 66 65 218 85 219 132]]
--- FAIL: TestMetaVersionCheck (2.36s)
Error Trace: meta_test.go:126
Error: Should be true

panic: [PANIC] syncer.mock.check.sha.error:oldsha1[[13 130 71 83 146 111 171 52 28 28 65 71 228 71 235 240 155 188 73 50]],sha1:[[117 72 151 60 187 148 53 147 163 224 218 32 226 176 66 65 218 85 219 132]] [recovered]
panic: [PANIC] syncer.mock.check.sha.error:oldsha1[[13 130 71 83 146 111 171 52 28 28 65 71 228 71 235 240 155 188 73 50]],sha1:[[117 72 151 60 187 148 53 147 163 224 218 32 226 176 66 65 218 85 219 132]]

goroutine 25 [running]:
testing.tRunner.func1(0xc4201843c0)
/usr/local/Cellar/go/1.10.2/libexec/src/testing/testing.go:742 +0x567
panic(0x1597c80, 0xc4200a9220)
/usr/local/Cellar/go/1.10.2/libexec/src/runtime/panic.go:502 +0x24a
vendor/github.com/xelabs/go-mysqlstack/xlog.(*Log).Panic(0xc4200a92b0, 0x164a1dc, 0x33, 0xc420241ea8, 0x2, 0x2)
/Users/andy/go/src/radon/src/vendor/github.com/xelabs/go-mysqlstack/xlog/xlog.go:164 +0x202
syncer.mockSyncer.func2()
/Users/andy/go/src/radon/src/syncer/mock.go:83 +0x4e4
syncer.TestMetaVersionCheck(0xc4201843c0)
/Users/andy/go/src/radon/src/syncer/meta_test.go:127 +0x280
testing.tRunner(0xc4201843c0, 0x1652d38)
/usr/local/Cellar/go/1.10.2/libexec/src/testing/testing.go:777 +0x16e
created by testing.(*T).Run
/usr/local/Cellar/go/1.10.2/libexec/src/testing/testing.go:824 +0x565
FAIL syncer 2.402s
make: *** [testsyncer] Error

import package比较混乱

比如src/binlog/binlog/go文件中

import (
	"config"
	"os"
	"path"
	"path/filepath"
	"sync"
	"time"
	"xbase"
	"xbase/sync2"

	"github.com/xelabs/go-mysqlstack/xlog"
)

存在引用当前$GOPATH下面的package config等等
有存在github项目github.com/xelabs/go-mysqlstack/xlog

缺点:
标准库和自己的库没有区分开
别人无法引用radon项目存在的库

个人建议

import (
	"os"
	"path"
	"path/filepath"
	"sync"
	"time"

        "github.com/radondb/radon/config"
	"github.com/radondb/radon/xbase"
	"github.com/radondb/radon/xbase/sync2"

	"github.com/xelabs/go-mysqlstack/xlog"
)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.